From 95dc724d0f17e97227dbe9ec178731e560d5e99d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 2 Feb 2023 22:59:41 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7234 --- app/src/protyle/wysiwyg/list.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/wysiwyg/list.ts b/app/src/protyle/wysiwyg/list.ts index 1fc5a4e6c..04994be41 100644 --- a/app/src/protyle/wysiwyg/list.ts +++ b/app/src/protyle/wysiwyg/list.ts @@ -537,13 +537,13 @@ export const listOutdent = (protyle: IProtyle, liItemElements: Element[], range: lastBlockElement.setAttribute("data-type", "NodeList"); lastBlockElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); lastBlockElement.innerHTML = `
${Constants.ZWSP}
`; - liItemElements[0].lastElementChild.before(lastBlockElement); doOperations.push({ action: "insert", id: newId, data: lastBlockElement.outerHTML, previousID: liItemElements[0].lastElementChild.previousElementSibling.getAttribute("data-node-id"), }); + liItemElements[0].lastElementChild.before(lastBlockElement); } let previousID; while (nextElement && !nextElement.classList.contains("protyle-attr")) { @@ -572,8 +572,7 @@ export const listOutdent = (protyle: IProtyle, liItemElements: Element[], range: undoOperations.push({ action: "move", id: nextId, - parentID: lastBlockElement.getAttribute("data-node-id"), - previousID: previousID || nextElement.previousElementSibling?.getAttribute("data-node-id"), + previousID: previousID || lastBlockElement.parentElement?.getAttribute("data-node-id"), }); previousID = nextId; const tempElement = nextElement;