Skip to content

Commit 2e53603

Browse files
committed
Merge branch 'master' of github.com:leo-buneev/vuepress-plugin-fulltext-search
2 parents 62144e6 + 1e062bc commit 2e53603

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

components/SearchBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363
const result = this.query
6464
.trim()
6565
.toLowerCase()
66-
.split(/[^\p{L}]+/iu)
66+
.split(/[^\p{L}\p{N}_]+/iu)
6767
.filter(t => t)
6868
return result
6969
},

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ const htmlToText = require('html-to-text')
44
module.exports = options => ({
55
extendPageData($page) {
66
try {
7-
const { html } = $page._context.markdown.render($page._strippedContent)
7+
const { html } = $page._context.markdown.render($page._strippedContent || '')
88

99
const plaintext = htmlToText.fromString(html, {
1010
wordwrap: null,
1111
hideLinkHrefIfSameAsText: true,
1212
ignoreImage: true,
13+
ignoreHref: true,
1314
uppercaseHeadings: false,
15+
tables: true,
1416
})
1517

1618
for (const h of $page.headers || []) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-plugin-fulltext-search",
3-
"version": "2.0.3",
3+
"version": "2.0.6",
44
"description": "Adds full-text search capabilities to your vuepress site with a help of flexsearch library.",
55
"main": "index.js",
66
"repository": "https://github.com/leo-buneev/vuepress-plugin-fulltext-search.git",
@@ -10,9 +10,9 @@
1010
"lint": "cross-env NODE_ENV=production eslint --max-warnings=0 --ext .js,.vue,.md ."
1111
},
1212
"dependencies": {
13-
"flexsearch": "nextapps-de/flexsearch",
13+
"flexsearch": "^0.6.32",
1414
"html-to-text": "^5.1.1",
15-
"lodash": "^4.17.15",
15+
"lodash": "^4.17.19",
1616
"vuepress": "^1.4.0"
1717
},
1818
"devDependencies": {

services/flexsearchSvc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434
if (cyrillicPages.length) {
3535
cyrillicIndex = new Flexsearch({
3636
...indexSettings,
37-
encode: false,
37+
encode: 'icase',
3838
split: /\s+/,
3939
tokenize: 'forward',
4040
})

yarn.lock

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,9 +1658,9 @@ bluebird@^3.1.1, bluebird@^3.5.5:
16581658
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
16591659

16601660
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
1661-
version "4.11.8"
1662-
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
1663-
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
1661+
version "4.11.9"
1662+
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
1663+
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
16641664

16651665
16661666
version "1.19.0"
@@ -3007,9 +3007,9 @@ electron-to-chromium@^1.3.380:
30073007
integrity sha512-M7JHfp32Bq6Am59AWgglh2d3nqe6y8Y94Vcb/AXUsO3DGvKUHYI5ML9+U5oNShfdOEfurrrjKSoSgFt2mz7mpw==
30083008

30093009
elliptic@^6.0.0:
3010-
version "6.5.2"
3011-
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
3012-
integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
3010+
version "6.5.3"
3011+
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
3012+
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
30133013
dependencies:
30143014
bn.js "^4.4.0"
30153015
brorand "^1.0.1"
@@ -3693,9 +3693,10 @@ flatted@^2.0.0:
36933693
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
36943694
integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==
36953695

3696-
flexsearch@nextapps-de/flexsearch#0.7.0:
3697-
version "0.7.0"
3698-
resolved "https://codeload.github.com/nextapps-de/flexsearch/tar.gz/128395ffbe96fcb636d40b0828ca4521e2cf7669"
3696+
flexsearch@^0.6.32:
3697+
version "0.6.32"
3698+
resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.6.32.tgz#1e20684d317af65baa445cdd9864a5f5b320f510"
3699+
integrity sha512-EF1BWkhwoeLtbIlDbY/vDSLBen/E5l/f1Vg7iX5CDymQCamcx1vhlc3tIZxIDplPjgi0jhG37c67idFbjg+v+Q==
36993700

37003701
flush-write-stream@^1.0.0:
37013702
version "1.1.1"
@@ -5126,9 +5127,14 @@ lodash.uniq@^4.5.0:
51265127
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
51275128

51285129
lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.3, lodash@^4.17.5:
5129-
version "4.17.15"
5130-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
5131-
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
5130+
version "4.17.19"
5131+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
5132+
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
5133+
5134+
lodash@^4.17.19:
5135+
version "4.17.19"
5136+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
5137+
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
51325138

51335139
loglevel@^1.6.6:
51345140
version "1.6.7"
@@ -9200,9 +9206,9 @@ websocket-driver@>=0.5.1:
92009206
websocket-extensions ">=0.1.1"
92019207

92029208
websocket-extensions@>=0.1.1:
9203-
version "0.1.3"
9204-
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
9205-
integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
9209+
version "0.1.4"
9210+
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
9211+
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
92069212

92079213
when@~3.6.x:
92089214
version "3.6.4"

0 commit comments

Comments
 (0)