From 71110aeead73bccaabee4965e6fe7c3b1e06c640 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 20 Apr 2023 18:43:14 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8037 --- app/src/protyle/hint/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 82c57a8cfbe..4e28e7b348d 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -488,8 +488,11 @@ ${unicode2Emoji(emoji.unicode, true)}`; tempElement.innerHTML = value.replace(//g, "").replace(/<\/mark>/g, ""); tempElement = tempElement.firstElementChild as HTMLDivElement; 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", { type: "id",