forked from MapComplete/MapComplete
Remove all usages of 'nano-markdown', use centralized 'Markdown.svelte'-instead
This commit is contained in:
parent
181965efd9
commit
fc6d86397e
8 changed files with 27 additions and 106 deletions
|
|
@ -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}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue