diff --git a/src/components/Markdown.svelte b/src/components/Markdown.svelte index 4899f2af3..5a384e735 100644 --- a/src/components/Markdown.svelte +++ b/src/components/Markdown.svelte @@ -250,6 +250,9 @@ padding-left: 1.25rem; margin-bottom: 1rem; } + .markdown :global(.list-content) { + margin: 1rem 0; + } .markdown :global(li > ul) { margin-bottom: 0rem; } diff --git a/src/lib/markdown.ts b/src/lib/markdown.ts index bde4f4218..f5ea35756 100644 --- a/src/lib/markdown.ts +++ b/src/lib/markdown.ts @@ -125,6 +125,17 @@ export const renderer = { return `${text}`; }, + listitem(text: string) { + const hasLineBreaks = text.trim().indexOf("\n"); + if (hasLineBreaks === -1) { + return `
  • ${text}
  • `; + } + const [first, ...remaining] = text.trim().split("\n"); + const liContent = `${first}
    ${remaining.join( + "\n", + )}
    `; + return `
  • ${liContent}
  • `; + }, }; export const markdownExtensions = [