From aa5f5ddc5f0b3a1be730f07060a6c2032f229366 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 9 Apr 2023 16:42:50 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7933 --- app/src/protyle/hint/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index a4b14fd50..eeef83792 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -162,6 +162,19 @@ ${unicode2Emoji(emoji.unicode, true)}`; 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) {