Skip to content

Commit 72d7de9

Browse files
committed
[search] fix highlight strings that are also regex patterns
SQUASHED: AUTO-COMMIT-src-components-tools-lively-index-search.js,
1 parent 979404d commit 72d7de9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/tools/lively-index-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export default class IndexSearch extends Morph {
271271

272272
var newText = file.text.replace(new RegExp(this.pattern, "g"), this.replace)
273273
file.replaced = newText
274-
var replacedText = this.hightlightPattern(newText, this.replace)
274+
var replacedText = this.hightlightPattern(newText, RegExp.escape(this.replace))
275275
var replacePreviewColumn = <td id="replace">{replacedText}</td>
276276
file.item.appendChild(replacePreviewColumn)
277277

0 commit comments

Comments
 (0)