Further cleanup, mostly with svelte 5 migration placeholder cleanup
This commit is contained in:
@@ -5,8 +5,6 @@ SPDX-License-Identifier: MPL-2.0
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { run } from 'svelte/legacy';
|
||||
|
||||
import type { Markdown } from '$lib/quiztivity/types';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { marked } from 'marked';
|
||||
@@ -18,11 +16,9 @@ SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
let { data }: Props = $props();
|
||||
|
||||
let rendered_html = $state('');
|
||||
|
||||
run(() => {
|
||||
rendered_html = browser ? DOMPurify.sanitize(marked.parse(data.markdown ?? '')) : '';
|
||||
});
|
||||
let rendered_html = $derived(
|
||||
browser ? DOMPurify.sanitize(marked.parse(data.markdown ?? '')) : ''
|
||||
);
|
||||
</script>
|
||||
|
||||
<div class="prose dark:prose-invert">
|
||||
|
||||
Reference in New Issue
Block a user