From 987cb07a4fa9e93b43387fb0b668675f6af8148f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 13 Aug 2022 09:46:52 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/5548 --- app/src/protyle/wysiwyg/input.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 21aa9415f..dafa3a6af 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -96,8 +96,10 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: } } else if (!blockElement.classList.contains("code-block") && (["[]", "[ ]", "[x]", "[X]", "【】", "【 】", "【x】", "【X】"].includes(editElement.textContent))) { const isDone = editElement.textContent.indexOf("x") > -1 || editElement.textContent.indexOf("X") > -1; - if (blockElement.parentElement.classList.contains("li")) { - if (blockElement.parentElement.parentElement.childElementCount === 2 && blockElement.parentElement.childElementCount === 3) { + if (blockElement.parentElement.classList.contains("li") && + blockElement.parentElement.childElementCount === 3 // https://ld246.com/article/1659315815506 + ) { + if (blockElement.parentElement.parentElement.childElementCount === 2) { html = `
`; id = blockElement.parentElement.parentElement.getAttribute("data-node-id"); blockElement = blockElement.parentElement.parentElement;