diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 039faf2ef..bd324d8b5 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -65,7 +65,6 @@ export class Gutter { window.siyuan.dragElement = undefined; } }); - // TODO:fold this.element.addEventListener("click", (event: MouseEvent & { target: HTMLInputElement }) => { const buttonElement = hasClosestByTag(event.target, "BUTTON"); if (!buttonElement) { @@ -1454,7 +1453,6 @@ export class Gutter { }); } }); - // TODO 字体大小 return styles; } diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 3cdc74cc8..e7846402f 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -220,6 +220,7 @@ const promiseTransaction = () => { if (operation.previousID) { Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.previousID}"]`)).forEach(item => { if (item.nextElementSibling?.getAttribute("data-node-id") !== operation.id && + !hasClosestByAttribute(item, "data-node-id", operation.id) && // 段落转列表会在段落后插入新列表 (item.getAttribute("data-type") === "NodeBlockQueryEmbed" || !hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed"))) { item.insertAdjacentHTML("afterend", operation.data); cursorElements.push(item.nextElementSibling); @@ -643,7 +644,7 @@ export const turnsIntoOneTransaction = (options: { protyle: IProtyle, selectsEle }); parentElement.innerHTML = html + '
'; } - const previousId = options.selectsElement[0].previousElementSibling ? options.selectsElement[0].previousElementSibling.getAttribute("data-node-id") : undefined; + const previousId = options.selectsElement[0].getAttribute("data-node-id"); const parentId = options.selectsElement[0].parentElement.getAttribute("data-node-id") || options.protyle.block.parentID; const doOperations: IOperation[] = [{ action: "insert", @@ -665,7 +666,7 @@ export const turnsIntoOneTransaction = (options: { protyle: IProtyle, selectsEle undoOperations.push({ action: "move", id: itemId, - previousID: itemPreviousId || previousId, + previousID: itemPreviousId || id, parentID: parentId }); if (options.type.endsWith("Ls")) {