From 758d2b62f5f21b6d8df6e1cd5dcaab0eaac876d1 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 19 Feb 2026 20:44:39 -0500 Subject: [PATCH] fix: Overly greedy background -> highlight (#11500) --- shared/editor/marks/Highlight.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared/editor/marks/Highlight.ts b/shared/editor/marks/Highlight.ts index aad4b1cbbb..654706f2fc 100644 --- a/shared/editor/marks/Highlight.ts +++ b/shared/editor/marks/Highlight.ts @@ -77,8 +77,12 @@ export default class Highlight extends Mark { }, }, { - style: "background-color", - getAttrs: (style: string) => { + tag: "span[style]", + getAttrs: (dom) => { + const style = dom.style.backgroundColor; + if (!style) { + return false; + } const matchedColor = Highlight.findMatchingPresetColor(style); // Only apply highlight if we found a matching preset color // or if the color is clearly a highlight (not white/transparent)