fix: Ensure highlighting matches HTML-escaped text in excerpts

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-13 10:53:26 -07:00
parent a8c18f5dca
commit ec2a720649
+3 -1
View File
@@ -25,7 +25,9 @@ export class TextProcessor {
try { try {
return text.replace( return text.replace(
new RegExp( new RegExp(
`(${matches.map(item => escapeRegExp(item.match)).join('|')})`, `(${matches
.map(item => escapeRegExp(escapeHTML(item.match)))
.join('|')})`,
'giu' 'giu'
), ),
`<span class="${highlightClass}">$1</span>` `<span class="${highlightClass}">$1</span>`