mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 11:00:52 +08:00
This commit is contained in:
parent
860ea7442a
commit
987cb07a4f
@ -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))) {
|
} 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;
|
const isDone = editElement.textContent.indexOf("x") > -1 || editElement.textContent.indexOf("X") > -1;
|
||||||
if (blockElement.parentElement.classList.contains("li")) {
|
if (blockElement.parentElement.classList.contains("li") &&
|
||||||
if (blockElement.parentElement.parentElement.childElementCount === 2 && blockElement.parentElement.childElementCount === 3) {
|
blockElement.parentElement.childElementCount === 3 // https://ld246.com/article/1659315815506
|
||||||
|
) {
|
||||||
|
if (blockElement.parentElement.parentElement.childElementCount === 2) {
|
||||||
html = `<div data-subtype="t" data-node-id="${blockElement.parentElement.parentElement.getAttribute("data-node-id")}" data-type="NodeList" class="list"><div data-marker="*" data-subtype="t" data-node-id="${blockElement.parentElement.getAttribute("data-node-id")}" data-type="NodeListItem" class="li${isDone ? " protyle-task--done" : ""}"><div class="protyle-action protyle-action--task"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div><div data-node-id="${id}" data-type="NodeParagraph" class="p"><div contenteditable="true" spellcheck="false"><wbr></div><div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`;
|
html = `<div data-subtype="t" data-node-id="${blockElement.parentElement.parentElement.getAttribute("data-node-id")}" data-type="NodeList" class="list"><div data-marker="*" data-subtype="t" data-node-id="${blockElement.parentElement.getAttribute("data-node-id")}" data-type="NodeListItem" class="li${isDone ? " protyle-task--done" : ""}"><div class="protyle-action protyle-action--task"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div><div data-node-id="${id}" data-type="NodeParagraph" class="p"><div contenteditable="true" spellcheck="false"><wbr></div><div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`;
|
||||||
id = blockElement.parentElement.parentElement.getAttribute("data-node-id");
|
id = blockElement.parentElement.parentElement.getAttribute("data-node-id");
|
||||||
blockElement = blockElement.parentElement.parentElement;
|
blockElement = blockElement.parentElement.parentElement;
|
||||||
|
Loading…
Reference in New Issue
Block a user