fix: Overly greedy background -> highlight (#11500)

This commit is contained in:
Tom Moor
2026-02-19 20:44:39 -05:00
committed by GitHub
parent b90ff98cef
commit 758d2b62f5
+6 -2
View File
@@ -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)