fix: Improved phrase matching in search (#6800)
* fix: Improved phrase matching in search * test
This commit is contained in:
@@ -37,9 +37,8 @@ type Props = {
|
||||
const SEARCH_RESULT_REGEX = /<b\b[^>]*>(.*?)<\/b>/gi;
|
||||
|
||||
function replaceResultMarks(tag: string) {
|
||||
// don't use SEARCH_RESULT_REGEX here as it causes
|
||||
// an infinite loop to trigger a regex inside it's own callback
|
||||
return tag.replace(/<b\b[^>]*>(.*?)<\/b>/gi, "$1");
|
||||
// don't use SEARCH_RESULT_REGEX directly here as it causes an infinite loop
|
||||
return tag.replace(new RegExp(SEARCH_RESULT_REGEX.source), "$1");
|
||||
}
|
||||
|
||||
function DocumentListItem(
|
||||
|
||||
Reference in New Issue
Block a user