diff --git a/server/prisma/dev.db b/server/prisma/dev.db index a7ef6ab..eca1353 100644 Binary files a/server/prisma/dev.db and b/server/prisma/dev.db differ diff --git a/webapp/src/lib/components/MarkdownRenderer.svelte b/webapp/src/lib/components/MarkdownRenderer.svelte index 6378693..feb61f7 100644 --- a/webapp/src/lib/components/MarkdownRenderer.svelte +++ b/webapp/src/lib/components/MarkdownRenderer.svelte @@ -12,6 +12,7 @@ import Blockquote from '$lib/marked/renderers/Blockquote.svelte'; import MathInline from '$lib/marked/renderers/MathInline.svelte'; import MathBlock from '$lib/marked/renderers/MathBlock.svelte'; + import ListItem from '$lib/marked/renderers/ListItem.svelte'; export let plaintext: string; @@ -31,6 +32,7 @@ prose-blockquote:first:before:content-['']" renderers={{ heading: Heading, list: List, + listitem: ListItem, link: Link, 'internal-link': InternalLink, 'internal-embed': InternalEmbed, diff --git a/webapp/src/lib/marked/extensions.ts b/webapp/src/lib/marked/extensions.ts index d2c135a..bb27d04 100644 --- a/webapp/src/lib/marked/extensions.ts +++ b/webapp/src/lib/marked/extensions.ts @@ -85,7 +85,6 @@ const MathInline = { tokenizer(src: string) { const match = src.match(/^(\${1})((?:\\.|[^$])+)\1/); if (match) { - console.log(src, match); return { type: 'math-inline', raw: match[0], @@ -106,7 +105,6 @@ const MathBlock = { tokenizer(src: string) { const match = src.match(/^(\${2})((?:\\.|[^$]|\n)+)\1/); if (match) { - console.log(src, match); return { type: 'math-block', raw: match[0], @@ -117,39 +115,6 @@ const MathBlock = { } }; -// const MathInline = { -// name: 'math-block', -// level: 'inline', -// start(src: string) { -// return src.indexOf('$'); -// }, - -// tokenizer(src: string) { -// // console.log(src); -// const match = src.match(/^(\${1,2})((?:\\.|[^$]|\n)+)\1/m); -// if (match) { -// console.log(src, match); -// if (match[1] == '$') { -// console.log('inline'); -// return { -// type: 'math-inline', -// raw: match[0], -// text: match[2].trim() -// }; -// } else if (match[1] == '$$') { -// console.log('block'); - -// return { -// type: 'math-block', -// raw: match[0], -// text: match[2].trim() -// }; -// } -// } -// return false; -// } -// }; - export default [ InternalLinkExtension, InternalEmbedExtension, @@ -158,5 +123,3 @@ export default [ MathBlock, MathInline ]; - -// ^\#([\w\/]+)\W* diff --git a/webapp/src/lib/marked/renderers/List.svelte b/webapp/src/lib/marked/renderers/List.svelte index aa05d57..60e9233 100644 --- a/webapp/src/lib/marked/renderers/List.svelte +++ b/webapp/src/lib/marked/renderers/List.svelte @@ -1,11 +1,14 @@ {#if ordered} -
+
{:else} {/if} diff --git a/webapp/src/lib/marked/renderers/ListItem.svelte b/webapp/src/lib/marked/renderers/ListItem.svelte new file mode 100644 index 0000000..3158a25 --- /dev/null +++ b/webapp/src/lib/marked/renderers/ListItem.svelte @@ -0,0 +1,23 @@ + + +{#if task || checked} +
  • +
    + + + +
    +
  • +{:else} +
  • +{/if}