Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9264

Vanessa17d2a16a9477
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index da22ed4092..eb3533b699 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -1579,13 +1579,17 @@ export class Gutter {
id,
level
}, (response) => {
- response.data.doOperations.forEach((operation: IOperation) => {
+ response.data.doOperations.forEach((operation: IOperation, index: number) => {
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach((itemElement: HTMLElement) => {
itemElement.outerHTML = operation.data;
});
+ // 使用 outer 后元素需要重新查询
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach((itemElement: HTMLElement) => {
mathRender(itemElement);
});
+ if (index === 0) {
+ focusBlock(protyle.wysiwyg.element.querySelector(`[data-node-id="${operation.id}"]`), protyle.wysiwyg.element, true);
+ }
});
transaction(protyle, response.data.doOperations, response.data.undoOperations);
});