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

This commit is contained in:
Tom Moor authored and GitHub committed 2026-02-20 01:44:39 +00:00
1 parent b90ff98cef
commit 758d2b62f5
1 file changed
+6 -2
+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)