From 59c5f2550247a708c2b9a94403d5edefe6ff559e Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:52:28 +0000 Subject: [PATCH] fix marked --- .../src/lib/markdown/utils/marked.utils.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/editor-ext/src/lib/markdown/utils/marked.utils.ts b/packages/editor-ext/src/lib/markdown/utils/marked.utils.ts index 15797711..04dc1978 100644 --- a/packages/editor-ext/src/lib/markdown/utils/marked.utils.ts +++ b/packages/editor-ext/src/lib/markdown/utils/marked.utils.ts @@ -5,18 +5,23 @@ import { mathInlineExtension } from "./math-inline.marked"; marked.use({ renderer: { - // @ts-ignore - list(body: string, isOrdered: boolean, start: number) { - if (isOrdered) { - const startAttr = start !== 1 ? ` start="${start}"` : ""; - return `
    \n${body}
\n`; + list({ ordered, start, items }) { + let body = ""; + for (const item of items) { + body += this.listitem(item); } - const dataType = body.includes(`\n${body}\n`; + } + + const isTaskList = items.some((item) => item.task); + const dataType = isTaskList ? ' data-type="taskList"' : ""; return `\n${body}\n`; }, - // @ts-ignore - listitem({ text, raw, task: isTask, checked: isChecked }): string { + listitem({ tokens, task: isTask, checked: isChecked }) { + const text = this.parser.parse(tokens); if (!isTask) { return `
  • ${text}
  • \n`; }