From 7e31f7c6ce59864d667d45133c0ab7e1b15e0c56 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 12 Feb 2025 16:38:11 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14019 --- app/src/protyle/toolbar/Font.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts index fcf725d53..97a04c75b 100644 --- a/app/src/protyle/toolbar/Font.ts +++ b/app/src/protyle/toolbar/Font.ts @@ -338,7 +338,18 @@ export const setFontStyle = (textElement: HTMLElement, textOption: ITextOption) export const hasSameTextStyle = (currentElement: HTMLElement, sideElement: HTMLElement, textObj: ITextOption) => { if (!textObj) { - return true; + // https://github.com/siyuan-note/siyuan/issues/14019 + if (currentElement.nodeType !== 3 && sideElement.nodeType !== 3 && + // 当为 span 时,都经过 isArrayEqual 判断 + sideElement.style.color === currentElement.style.color && + sideElement.style.webkitTextFillColor === currentElement.style.webkitTextFillColor && + sideElement.style.webkitTextStroke === currentElement.style.webkitTextStroke && + sideElement.style.textShadow === currentElement.style.textShadow && + sideElement.style.backgroundColor === currentElement.style.backgroundColor && + sideElement.style.fontSize === currentElement.style.fontSize) { + return true; + } + return false; } if (textObj.type === "inline-math" || textObj.type === "inline-memo" || textObj.type === "a") { return false;