fix: Improve search term highlighting for words with punctuation
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -47,7 +47,7 @@ export class TextProcessor {
|
|||||||
strings.sort((a, b) => b.length - a.length)
|
strings.sort((a, b) => b.length - a.length)
|
||||||
|
|
||||||
const joined = `(${strings
|
const joined = `(${strings
|
||||||
.map(s => `\\b${escapeRegExp(s)}\\b|${escapeRegExp(s)}`)
|
.map(s => `(?<!\\w)${escapeRegExp(s)}(?!\\w)`)
|
||||||
.join('|')})`
|
.join('|')})`
|
||||||
|
|
||||||
return new RegExp(`${joined}`, 'gui')
|
return new RegExp(`${joined}`, 'gui')
|
||||||
|
|||||||
Reference in New Issue
Block a user