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

Vanessa482c1a8ba6cc
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index d970ffcedb..4a5d4bd1d7 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -746,21 +746,23 @@ export class Toolbar {
focusByRange(this.range);
const showMenuElement = newNodes[0] as HTMLElement;
- const showMenuTypes = (showMenuElement.getAttribute("data-type") || "").split(" ");
- if (type === "inline-math") {
- mathRender(nodeElement);
- if (selectText === "" && showMenuTypes.includes("inline-math")) {
- protyle.toolbar.showRender(protyle, showMenuElement, undefined, html);
- }
- } else if (type === "inline-memo") {
- if (!showMenuElement.getAttribute("data-inline-memo-content") &&
- showMenuTypes.includes("inline-memo")) {
- protyle.toolbar.showRender(protyle, showMenuElement, newNodes as Element[], html);
- }
- } else if (type === "a") {
- if (showMenuTypes.includes("a") &&
- (showMenuElement.textContent.replace(Constants.ZWSP, "") === "" || !showMenuElement.getAttribute("data-href"))) {
- linkMenu(protyle, showMenuElement, showMenuElement.getAttribute("data-href") ? true : false);
+ if (showMenuElement.nodeType !== 3) {
+ const showMenuTypes = (showMenuElement.getAttribute("data-type") || "").split(" ");
+ if (type === "inline-math") {
+ mathRender(nodeElement);
+ if (selectText === "" && showMenuTypes.includes("inline-math")) {
+ protyle.toolbar.showRender(protyle, showMenuElement, undefined, html);
+ }
+ } else if (type === "inline-memo") {
+ if (!showMenuElement.getAttribute("data-inline-memo-content") &&
+ showMenuTypes.includes("inline-memo")) {
+ protyle.toolbar.showRender(protyle, showMenuElement, newNodes as Element[], html);
+ }
+ } else if (type === "a") {
+ if (showMenuTypes.includes("a") &&
+ (showMenuElement.textContent.replace(Constants.ZWSP, "") === "" || !showMenuElement.getAttribute("data-href"))) {
+ linkMenu(protyle, showMenuElement, showMenuElement.getAttribute("data-href") ? true : false);
+ }
}
}
}