Skip to content

Commit

Permalink
Merge pull request #545 from Tonksthebear/highlight-text-update
Browse files Browse the repository at this point in the history
Text Highlighter Update
  • Loading branch information
brianvoe authored May 8, 2024
2 parents 90405d3 + 00bcf03 commit 6fdc91a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slim-select/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ export default class Render {
private highlightText(str: string, search: any, className: string) {
// the completed string will be itself if already set, otherwise, the string that was passed in
let completedString: any = str
const regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*</)', 'i')
const regex = new RegExp('(?![^<]*>)(' + search.trim() + ')(?![^<]*>[^<>]*</)', 'i')

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

0 comments on commit 6fdc91a

Please sign in to comment.