mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 19:40:48 +08:00
This commit is contained in:
parent
326c902d14
commit
b0ca44de00
@ -11,10 +11,12 @@ export const turnIntoTaskList = (protyle: IProtyle, type: string, blockElement:
|
|||||||
["[]", "【】"].includes(editElement.innerHTML.substring(0, 2))
|
["[]", "【】"].includes(editElement.innerHTML.substring(0, 2))
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const contextStar2tIndex = (editElement.innerHTML.indexOf("】") + 1);
|
const contextStar2tIndex = editElement.innerHTML.indexOf("】") + 1;
|
||||||
let contextStartIndex = (editElement.innerHTML.indexOf("]") + 1) || contextStar2tIndex;
|
let contextStartIndex = editElement.innerHTML.indexOf("]") + 1;
|
||||||
if (contextStartIndex !== -1 && contextStar2tIndex < contextStartIndex) {
|
if (contextStartIndex === 0) {
|
||||||
contextStartIndex = contextStar2tIndex;
|
contextStartIndex = contextStar2tIndex;
|
||||||
|
} else if (contextStartIndex > 0 && contextStar2tIndex > 0) {
|
||||||
|
contextStartIndex = Math.min(contextStartIndex, contextStar2tIndex);
|
||||||
}
|
}
|
||||||
const isDone = editElement.innerHTML.substring(1, 2).toLowerCase() === "x";
|
const isDone = editElement.innerHTML.substring(1, 2).toLowerCase() === "x";
|
||||||
if (blockElement.parentElement.classList.contains("li") &&
|
if (blockElement.parentElement.classList.contains("li") &&
|
||||||
|
Loading…
Reference in New Issue
Block a user