Skip to content

Commit 6fdc91a

Browse files
authored
Merge pull request #545 from Tonksthebear/highlight-text-update
Text Highlighter Update
2 parents 90405d3 + 00bcf03 commit 6fdc91a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/slim-select/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ export default class Render {
12851285
private highlightText(str: string, search: any, className: string) {
12861286
// the completed string will be itself if already set, otherwise, the string that was passed in
12871287
let completedString: any = str
1288-
const regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*</)', 'i')
1288+
const regex = new RegExp('(?![^<]*>)(' + search.trim() + ')(?![^<]*>[^<>]*</)', 'i')
12891289

12901290
// If the regex doesn't match the string just exit
12911291
if (!str.match(regex)) {

0 commit comments

Comments
 (0)