Browse Source

:art: fix https://github.com/siyuan-note/siyuan/issues/8037

Vanessa 2 years ago
parent
commit
71110aeead
1 changed files with 5 additions and 2 deletions
  1. 5 2
      app/src/protyle/hint/index.ts

+ 5 - 2
app/src/protyle/hint/index.ts

@@ -488,8 +488,11 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
             tempElement.innerHTML = value.replace(/<mark>/g, "").replace(/<\/mark>/g, "");
             tempElement.innerHTML = value.replace(/<mark>/g, "").replace(/<\/mark>/g, "");
             tempElement = tempElement.firstElementChild as HTMLDivElement;
             tempElement = tempElement.firstElementChild as HTMLDivElement;
             if (refIsS) {
             if (refIsS) {
-                tempElement.setAttribute("data-subtype", "s");
-                tempElement.innerText = range.toString().replace(this.splitChar, "");
+                const staticText = range.toString().replace(this.splitChar, "")
+                if (staticText) {
+                    tempElement.setAttribute("data-subtype", "s");
+                    tempElement.innerText = staticText;
+                }
             }
             }
             protyle.toolbar.setInlineMark(protyle, "block-ref", "range", {
             protyle.toolbar.setInlineMark(protyle, "block-ref", "range", {
                 type: "id",
                 type: "id",