Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: https://github.com/siyuan-note/siyuan/issues/14666

Vanessa21b86f5592df
diff --git a/app/src/protyle/wysiwyg/turnIntoList.ts b/app/src/protyle/wysiwyg/turnIntoList.ts
index 845c873c04..f0b30af2d9 100644
--- a/app/src/protyle/wysiwyg/turnIntoList.ts
+++ b/app/src/protyle/wysiwyg/turnIntoList.ts
@@ -11,7 +11,11 @@ export const turnIntoTaskList = (protyle: IProtyle, type: string, blockElement:
["[]", "【】"].includes(editElement.innerHTML.substring(0, 2))
)
) {
- const contextStartIndex = (editElement.innerHTML.indexOf("]") + 1) || (editElement.innerHTML.indexOf("】") + 1);
+ const contextStar2tIndex = (editElement.innerHTML.indexOf("】") + 1);
+ let contextStartIndex = (editElement.innerHTML.indexOf("]") + 1) || contextStar2tIndex;
+ if (contextStartIndex !== -1 && contextStar2tIndex < contextStartIndex) {
+ contextStartIndex = contextStar2tIndex;
+ }
const isDone = editElement.innerHTML.substring(1, 2).toLowerCase() === "x";
if (blockElement.parentElement.classList.contains("li") &&
blockElement.parentElement.childElementCount === 3 // https://ld246.com/article/1659315815506