Remove all usages of 'nano-markdown', use centralized 'Markdown.svelte'-instead

This commit is contained in:
Pieter Vander Vennet 2024-04-27 23:44:54 +02:00
parent 181965efd9
commit fc6d86397e
8 changed files with 27 additions and 106 deletions

View file

@ -1,17 +1,17 @@
<script lang="ts">
import markdownit from "markdown-it"
import { UIEventSource } from "../../Logic/UIEventSource"
const md = markdownit()
import { marked } from "marked"
export let src: string
export let srcWritable: UIEventSource<string> = undefined
srcWritable?.addCallbackAndRunD(t => {
src = t
})
if(typeof src !== "string") {
if(src !== undefined && typeof src !== "string") {
console.trace("Got a non-string object in Markdown", src)
throw "Markdown.svelte got a non-string object"
}
</script>
{#if src?.length > 0}
{@html md.render(src)}
{@html marked.parse(src)}
{/if}