Skip to content

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

:art: Support setting document title to empty https://github.com/siyuan-note/siyuan/pull/17110#issuecomment-4043784534 (#17190)

Jeffrey Chen598fb5914344
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index f25631d58c..01373d77b0 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -214,6 +214,11 @@ export class Protyle {
} else {
this.protyle.title.setTitle(data.data.title, data.data.empty);
}
+ if (data.data.empty) {
+ this.protyle.wysiwyg.element.setAttribute(Constants.CUSTOM_SY_TITLE_EMPTY, "true");
+ } else {
+ this.protyle.wysiwyg.element.removeAttribute(Constants.CUSTOM_SY_TITLE_EMPTY);
+ }
}
// update ref
this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {