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:
@@ -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>`
|
||||||
|
|||||||
Reference in New Issue
Block a user