Use RegExp class to specify sentence boundary
This commit is contained in:
parent
ccfac4e297
commit
4f57fb0152
1 changed files with 1 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue