Unified components and observable structure

This commit is contained in:
squidfunk
2020-03-05 17:17:15 +01:00
parent 6e6868b8cd
commit 9738c12cc9
149 changed files with 11475 additions and 1095 deletions

View File

@@ -20,8 +20,6 @@
* IN THE SOFTWARE.
*/
import * as escapeRegExp from "escape-string-regexp"
import { SearchIndexConfig } from "../_"
import { SearchDocument } from "../document"
@@ -78,7 +76,9 @@ export function setupSearchHighlighter(
/* Create search term match expression */
const match = new RegExp(`(^|${config.separator})(${
escapeRegExp(query).replace(separator, "|")
query
.replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&") // TODO: taken from escape-string-regexp
.replace(separator, "|")
})`, "img")
/* Highlight document */