You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Svelte, variables are normally rendered as plain text, but you can render HTML using syntax like {@html expression} see more details and demo. It would be nice to be able to optionally limit which tags are allowed when rendering, for example:
<script>
let string ="<p><em>this</em> string contains<br> some <strong>HTML!!!</strong></p>";
</script>
<p>{@html[strong, em] string}</p>
Output should look like this:
<p>this string contains<br> some HTML!!!</p>
The text was updated successfully, but these errors were encountered:
In Svelte, variables are normally rendered as plain text, but you can render HTML using syntax like
{@html expression}
see more details and demo. It would be nice to be able to optionally limit which tags are allowed when rendering, for example:Output should look like this:
<p>this string contains<br> some HTML!!!</p>
The text was updated successfully, but these errors were encountered: