You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
<script> |
|
import DOMPurify from "dompurify"; |
|
import { onMount } from "svelte"; |
|
|
|
export let html; |
|
export let text; |
|
let purify; |
|
|
|
onMount(() => { |
|
purify = (html) => DOMPurify.sanitize(html); |
|
}); |
|
</script> |
|
|
|
{#if purify} |
|
{@html html} |
|
{:else if text}{text}{/if}
|
|
|