qotnews/webapp/src/components/Html.svelte
Jason Schwarzenberger cee104ea06 placehold.
2020-12-02 14:48:31 +13:00

17 lines
275 B
Svelte

<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}