yaru22 / angular-md

Angular directive to render Markdown text. It's built on blazingly fast markdown parser 'marked'.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not parse html code

thatisuday opened this issue · comments

This sounds very strange as this works in your demo.

I am trying to parse

```<span>Hey there...</span>```

but this output to only Hey there and span tags are removed.
This must be because angular sanitizing the generated code by marked parser.
Is there any way to handle this?

Found. It won't work inline because you are retrieving markdown content from directive element using $elem.text() which will strip html tags. $elem.html() would work, but don't know if that will lead to any consequences. I am sticking with ng-model approach.