marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.24k stars 643 forks source link

similar tag like dangerouslySetInnerHTML #1874

Closed xd-dw closed 1 year ago

xd-dw commented 1 year ago

is there in Marko a similar tag like dangerouslySetInnerHTML in react so that i can dynamically render html text as html? eg. <div dangerouslySetInnerHTML={{ __html: rawHTMLAsText }}></div> where rawHTMLAsText=<em>Process</em> is <em>not</em> <em>defined</em>

DylanPiercey commented 1 year ago

You use $!{EXPRESSION} to interpolate in unescaped text content (you don't need a tag for this).

See https://markojs.com/docs/syntax/#dynamic-text