atom / etch

Builds components using a simple and explicit API around virtual-dom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Escape html

mateusvahl opened this issue · comments

Hi, I would like to now if there's a way of scape html,
I'm parsing a markdown and would like to insert the content inside my etch component
Something like: https://stackoverflow.com/questions/39758136/render-html-string-as-real-html-in-a-react-component
Thanks

Sorry, I don't understand. Do you want to escape HTML (i.e. replace < with &lt; etc) or do you want to render an HTML string?

Hi,
Render an html string as etch html,
I'm parsing a markdown and it html result should be inside my etch component.

Set innerHTML property on an ordinary HTML element. E.g.

<div innerHTML={yourHtmlString} />

See, f.ex. here for a more complete example (it's typescript, but I don't think it matters much)

Thanks @lierdakil. I'm going to close this out since we have a solution.