From 67577c89cffca1ab6d40a8913e51b7c3c6f91c85 Mon Sep 17 00:00:00 2001 From: Daniel Dada Date: Wed, 29 Oct 2025 12:29:55 +0300 Subject: [PATCH] fix: highlight colors when multiple list have different configurations --- src/content/HighlightEngine.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/HighlightEngine.ts b/src/content/HighlightEngine.ts index 28255bc..7aa4d8e 100644 --- a/src/content/HighlightEngine.ts +++ b/src/content/HighlightEngine.ts @@ -41,7 +41,7 @@ export class HighlightEngine { } } - private updateWordStyles(activeWords: ActiveWord[]): void { + private updateWordStyles(activeWords: ActiveWord[], matchCase: boolean): void { this.initializeStyleSheet(); while (this.styleSheet!.cssRules.length > 0) { @@ -61,7 +61,7 @@ export class HighlightEngine { this.styleSheet!.insertRule(rule, this.styleSheet!.cssRules.length); } - const lookup = word.text; + const lookup = matchCase ? word.text : word.text.toLowerCase(); this.wordStyleMap.set(lookup, uniqueStyles.get(styleKey)!); } } @@ -129,7 +129,7 @@ export class HighlightEngine { return; } - this.updateWordStyles(activeWords); + this.updateWordStyles(activeWords, matchCase); const wordMap = new Map(); for (const word of activeWords) {