Vanessa 2024-10-29 13:01:43 +08:00
parent 9cc9a2862a
commit 1c00b91aa7

View file

@ -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;