diff --git a/packages/trilium-core/src/services/search/services/search.ts b/packages/trilium-core/src/services/search/services/search.ts index d699069c53..72f8ef051d 100644 --- a/packages/trilium-core/src/services/search/services/search.ts +++ b/packages/trilium-core/src/services/search/services/search.ts @@ -691,7 +691,7 @@ function highlightSearchResults(searchResults: SearchResult[], highlightedTokens // which would make the resulting HTML string invalid. // { and } are used for marking and tag (to avoid matches on single 'b' character) // < and > are used for marking and - highlightedTokens = highlightedTokens.map((token) => token.replace("/[<\{\}]/g", "")).filter((token) => !!token?.trim()); + highlightedTokens = highlightedTokens.map((token) => token.replace(/[<>{}]/g, "")).filter((token) => !!token?.trim()); // sort by the longest, so we first highlight the longest matches highlightedTokens.sort((a, b) => (a.length > b.length ? -1 : 1));