Skip to content

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

:bug: fix https://github.com/siyuan-note/insider/issues/1084

Vanessa0e2971c43f88
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 039faf2ef6..bd324d8b50 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 3cdc74cc8c..e7846402fa 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 + '<div class="protyle-attr" contenteditable="false"></div>';
}
- 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")) {