Skip to content

Commit

Permalink
🎨 #14019
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 12, 2025
1 parent 68f929b commit 7e31f7c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/src/protyle/toolbar/Font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7e31f7c

Please sign in to comment.