Skip to content

Commit

Permalink
Use RegExp instead of replaceAll
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jan 11, 2021
1 parent b9501db commit 9276504
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function highlight<TItem extends RecentSearchesItem>({
_highlightResult: {
query: {
value: query
? item.query.replaceAll(
query,
? item.query.replace(
new RegExp(query.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'),
`__aa-highlight__${query}__/aa-highlight__`
)
: item.query,
Expand Down

0 comments on commit 9276504

Please sign in to comment.