evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Does not support normal HTML #295

Open Andrewyg opened 6 years ago

Andrewyg commented 6 years ago

Normally markdown editor should support html tag but if you write some thing like <a>hi</a> it'll become something like this <p>&lt;a&gt;hi&lt;/a&gt;</p this should be fine but how about <h1>hi</h1> it'll become <p><h1>hi</h1></p> where the browser will show

hi

begogna commented 6 years ago

I have found the same problem !

jduprey commented 6 years ago

Same here. markdown-js should honor existing HTML markup w/in the text, instead, it escapes it. Please fix?

3stacks commented 6 years ago

Any update? I'll have to use a different library if this isn't supported

EDIT: Oops, didn't realise this library was dead. There's a PR for adding HTML support that has been un-merged since 2014. https://github.com/evilstreak/markdown-js/pull/98

jduprey commented 6 years ago

marked - seems to be an acceptable replacement. https://github.com/chjj/marked

3stacks commented 6 years ago

@jduprey, I just switched over to this library last night. It's working perfectly for me, as you can override each individual render method, which allowed me to do all intermediate manipulations I needed.

Can't recommend it enough.

jduprey commented 6 years ago

Yes. I, too, switched slightly after my original post and it seems to work great.