Skip to content

Commit 6bee14d

Browse files
authored
Merge pull request #10 from neilboyd/trim-length
highlight when match after snippet length
2 parents 5301e53 + c871f34 commit 6bee14d

File tree

8 files changed

+26
-17
lines changed

8 files changed

+26
-17
lines changed

dest/simple-jekyll-search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Simple-Jekyll-Search 1.13.0
2+
* Simple-Jekyll-Search 1.13.1
33
* Copyright 2015-2025, Christian Fei, Neil Boyd
44
* Licensed under the MIT License.
55
*/
@@ -349,7 +349,7 @@ function highlightMatchedText (value, query, snippetLength = 200) {
349349
}
350350

351351
// trim start and end to snippet length
352-
value = value.substring(s, snippetLength)
352+
value = value.substring(s, s + snippetLength)
353353

354354
// if end is a partial tag, or a complete opening tag, then trim it
355355
const t = value.indexOf('<', snippetLength - 3)

dest/simple-jekyll-search.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/js/simple-jekyll-search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Simple-Jekyll-Search 1.13.0
2+
* Simple-Jekyll-Search 1.13.1
33
* Copyright 2015-2025, Christian Fei, Neil Boyd
44
* Licensed under the MIT License.
55
*/
@@ -349,7 +349,7 @@ function highlightMatchedText (value, query, snippetLength = 200) {
349349
}
350350

351351
// trim start and end to snippet length
352-
value = value.substring(s, snippetLength)
352+
value = value.substring(s, s + snippetLength)
353353

354354
// if end is a partial tag, or a complete opening tag, then trim it
355355
const t = value.indexOf('<', snippetLength - 3)

0 commit comments

Comments
 (0)