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/7933

Vanessaaa5f5ddc5f0b
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index a4b14fd501..eeef83792d 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -162,6 +162,19 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
return;
}
+ // https://github.com/siyuan-note/siyuan/issues/7933
+ if (this.splitChar === "#" ) {
+ const blockElement = hasClosestBlock(protyle.toolbar.range.startContainer);
+ if (blockElement && blockElement.getAttribute("data-type") === "NodeHeading") {
+ const blockIndex = getSelectionOffset(protyle.toolbar.range.startContainer, blockElement).start
+ if (blockElement.textContent.startsWith("#".repeat(blockIndex))) {
+ this.element.classList.add("fn__none");
+ clearTimeout(this.timeId);
+ return;
+ }
+ }
+ }
+
if (this.splitChar === ":") {
clearTimeout(this.timeId);
if (key) {