Converting a string containing markdown to HTML
Answered
Muscovy Duck posted this in #help-forum
Muscovy DuckOP
Hello! I have this string that I want to render as HTML in the page:
In my component, I have this:
But when rendered I see the actual lHTML (see image); what can I do to fix this?
"Testing a [link](/)."In my component, I have this:
{(await remark()
.use(html)
.process(subfeature.body)).toString()}But when rendered I see the actual lHTML (see image); what can I do to fix this?
5 Replies
Answer
(only when you trust the html is sanitised, which is already handled by remark (i think))
Muscovy DuckOP
oh right, I'll try thank you!
This is for a static website where there is no user input so there should be no risk. Thanks!
It works, wonderful thanks @joulev !