Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/14057

Vanessa46b004129d81
diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts
index d41a91c2a6..52b08a8f9c 100644
--- a/app/src/protyle/header/Title.ts
+++ b/app/src/protyle/header/Title.ts
@@ -66,6 +66,11 @@ export class Title {
if (event.isComposing) {
return;
}
+ if (this.editElement.textContent === "") {
+ this.editElement.querySelectorAll("br").forEach(item => {
+ item.remove()
+ });
+ }
this.rename(protyle);
});
this.editElement.addEventListener("compositionend", () => {
@@ -164,11 +169,6 @@ export class Title {
event.stopPropagation();
}
});
- this.editElement.addEventListener("keyup", (event: KeyboardEvent) => {
- this.editElement.querySelectorAll("br").forEach(item => {
- item.remove()
- })
- })
const iconElement = this.element.querySelector(".protyle-title__icon");
iconElement.addEventListener("click", () => {
if (window.siyuan.shiftIsPressed) {