summaryrefslogtreecommitdiffstats
path: root/assets/js/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/search.js')
-rw-r--r--assets/js/search.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/assets/js/search.js b/assets/js/search.js
index f37e15b..b66b12d 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -156,8 +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 = new RegExp('\\b\\.\\s', 'gm');
-
+ const sentenceBoundaryRegex = new RegExp(/(?=[^])(?:\P{Sentence_Terminal}|\p{Sentence_Terminal}(?!['"`\p{Close_Punctuation}\p{Final_Punctuation}\s]))*(?:\p{Sentence_Terminal}+['"`\p{Close_Punctuation}\p{Final_Punctuation}]*|$)/, 'gum');
const searchQueryHits = Array.from(
pageContent.matchAll(searchQueryRegex),
(m) => m.index