mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
cc976675f3
commit
aa5f5ddc5f
1 changed files with 13 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue