This commit is contained in:
@ -6,10 +6,11 @@ import "./main.css";
|
||||
import Prism from "prismjs";
|
||||
|
||||
import { onMount } from "svelte";
|
||||
import DOMPurify from "isomorphic-dompurify";
|
||||
|
||||
let version = 0;
|
||||
|
||||
let content = `
|
||||
let content_unsafe = `
|
||||
# This is a header
|
||||
This is a paragraph $E = mc^2$
|
||||
* This is a list
|
||||
@ -22,6 +23,14 @@ This is a paragraph $E = mc^2$
|
||||
|-------------|---------|
|
||||
| With two | columns |
|
||||
`;
|
||||
|
||||
let content: string = '';
|
||||
|
||||
$: content = (() => {
|
||||
let c = DOMPurify.sanitize(content_unsafe, {})
|
||||
// console.log(c)
|
||||
return c
|
||||
})()
|
||||
let source = "";
|
||||
|
||||
import { tick } from "svelte";
|
||||
@ -109,7 +118,7 @@ onMount(async () => {
|
||||
|
||||
</script>
|
||||
|
||||
<textarea name="content" id="content" bind:value={content}></textarea>
|
||||
<textarea name="content" id="content" bind:value={content_unsafe}></textarea>
|
||||
<button id="button" on:click={updateSource}>Render</button>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
Reference in New Issue
Block a user