summaryrefslogtreecommitdiffstats
path: root/assets/js
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-30 22:45:04 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-30 22:45:04 +0200
commit4f57fb0152e8de062f990e36dd6417174bef6700 (patch)
treef4bf4bbb9075d9d8536c920c6a8ecdc86b12174c /assets/js
parentccfac4e2978d4e2efedecf5200070a693ff01db4 (diff)
downloadgohugo-theme-ed-4f57fb0152e8de062f990e36dd6417174bef6700.tar.gz
Use RegExp class to specify sentence boundary
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/search.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/assets/js/search.js b/assets/js/search.js
index 2dc5eaa..f37e15b 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -156,7 +156,7 @@ function createSearchResultBlurb(query, pageContent) {
// term, we need a way to identify where each sentence begins/ends. This
// regex will be used to produce a list of all sentences from the page
// content.
- const sentenceBoundaryRegex = /\b\.\s/gm;
+ const sentenceBoundaryRegex = new RegExp('\\b\\.\\s', 'gm');
const searchQueryHits = Array.from(
pageContent.matchAll(searchQueryRegex),