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/siyuan/issues/6565

Vanessa520aa895fc2a
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 071cbfef03..9fd849d5e4 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -122,12 +122,9 @@ export class Protyle {
this.protyle.background.ial.title = data.data.title;
}
}
- if (this.protyle.options.render.title && this.protyle.block.parentID === data.data.id) {
- if (getSelection().rangeCount > 0 && this.protyle.element.contains(getSelection().getRangeAt(0).startContainer)) {
- // 编辑中的不用更新
- } else {
- this.protyle.title.setTitle(data.data.title);
- }
+ if (this.protyle.options.render.title && this.protyle.block.parentID === data.data.id &&
+ this.protyle.title.editElement.textContent !== data.data.title) {
+ this.protyle.title.setTitle(data.data.title);
}
// update ref
this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {