From 28a5109aca9c0a163f778949e59021aac0bc4742 Mon Sep 17 00:00:00 2001 From: tomdyqin Date: Tue, 24 Dec 2024 15:03:10 +0800 Subject: [PATCH] feat: fix todo list --- .../markdown/src/lib/remark-slate/remarkDefaultElementRules.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts index 9805959048..2b755593f4 100644 --- a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts +++ b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts @@ -82,7 +82,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { _node.children?.forEach((listItem) => { const defaultType = options.editor.getType({ key: 'p' }); const todoListType = options.editor.getType({ key: 'action_item' }) ?? defaultType - const listItemType = typeof listItem.checked !== 'undefined' ? todoListType : defaultType; + const listItemType = [false, true].includes(listItem.checked) ? todoListType : defaultType; if (!listItem.children) { listItems.push({ children: remarkTransformElementChildren(listItem, options),