Ask coding questions

← Back to all posts
What do I do/add/install to my chatroom to add text markdown?
h
UnluckyFroggy (917)

My chatroom uses socket.io and is built with nodejs. How do I add markdown to my chatroom?

Comments
hotnewtop
notGilbert (73)

When the client receives a message, pass it through a Markdown formatter like marked and set it as the innerHTML of whatever element.

Note that marked does not sanitize the HTML, so you'll probably want to do that beforehand.

UnluckyFroggy (917)

@notGilbert that's the problem, I understand what I need to do, I just have no idea how to do it.

UnluckyFroggy (917)

@notGilbert If I gave you edit access, do you think you could do it for me? I'll give you the five cycles for correct answer.

notGilbert (73)

@UnluckyFroggy

what's the repl called exactly? (or the link)