From 1c00b91aa749bab94c89d92c34e7e69faf294c7b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 29 Oct 2024 13:01:43 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/12922 --- app/src/protyle/toolbar/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 10255d511..7f370813a 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -493,7 +493,9 @@ export class Toolbar { hasSameTextStyle(item, nextElement, textObj)) { nextIndex = item.textContent.length; nextElement.innerHTML = item.textContent + nextElement.innerHTML; - } else if (item.textContent !== Constants.ZWSP) { + } else if (item.textContent !== Constants.ZWSP || + // tag 会有零宽空格 https://github.com/siyuan-note/siyuan/issues/12922 + (item.textContent === Constants.ZWSP && !rangeTypes.includes("img"))) { const inlineElement = document.createElement("span"); inlineElement.setAttribute("data-type", type); inlineElement.textContent = item.textContent;