forked from tanner/qotnews
parent
f524ecec7b
commit
8c40124e07
4 changed files with 22 additions and 41 deletions
@ -0,0 +1,15 @@ |
||||
<script> |
||||
import DOMPurify from "dompurify"; |
||||
import { onMount } from "svelte"; |
||||
|
||||
export let html; |
||||
let purify; |
||||
|
||||
onMount(() => { |
||||
purify = (html) => DOMPurify.sanitize(html); |
||||
}); |
||||
</script> |
||||
|
||||
{#if purify} |
||||
{@html html} |
||||
{:else}{html}{/if} |
Loading…
Reference in new issue