Skip to content

Commit 33e65f7

Browse files
committed
Fixed escape sequences on search separators
1 parent c5c45a1 commit 33e65f7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs/blog/2022/chinese-search-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ the [separator] includes the `\u200b` character:
6666
``` yaml
6767
plugins:
6868
- search:
69-
separator: '[\\s\\u200b\\-]'
69+
separator: '[\s\u200b\-]'
7070
```
7171
7272
That's all that is necessary.

docs/setup/setting-up-site-search.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The following configuration options are supported:
108108
``` yaml
109109
plugins:
110110
- search:
111-
separator: '[\\s\\-\\.]' # (1)!
111+
separator: '[\s\-\.]' # (1)!
112112
```
113113

114114
1. Tokenization itself is carried out by [lunr's default tokenizer], which
@@ -193,7 +193,7 @@ documents are tokenized:
193193
``` yaml
194194
plugins:
195195
- search:
196-
separator: "[\\s\\-,:!=\\[\\]()\"/]+|\\.(?!\\d)|&[lg]t;|(?!\\b)(?=[A-Z][a-z])"
196+
separator: '[\s\-,:!=\[\]()"/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
197197
```
198198

199199
The following section explains what can be achieved with tokenizer lookahead:

docs/upgrade.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ was renamed to `separator`:
11191119
``` yaml
11201120
plugins:
11211121
- search:
1122-
separator: '[\\s\\-\\.]+'
1122+
separator: '[\s\-\.]+'
11231123
lang:
11241124
- en
11251125
- de
@@ -1132,7 +1132,7 @@ was renamed to `separator`:
11321132
extra:
11331133
search:
11341134
language: en, de, ru
1135-
tokenizer: '[\\s\\-\\.]+'
1135+
tokenizer: '[\s\-\.]+'
11361136
```
11371137

11381138
[plugin options]: setup/setting-up-site-search.md#built-in-search-plugin

src/partials/languages/zh-Hant.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"meta.source": "來源",
3333
"search.config.lang": "ja",
3434
"search.config.pipeline": "trimmer, stemmer",
35-
"search.config.separator": "[\\,\\。]+",
35+
"search.config.separator": "[\\s\\-,。]+",
3636
"search.placeholder": "搜尋",
3737
"search.result.initializer": "正在初始化搜尋引擎",
3838
"search.result.placeholder": "鍵入以開始檢索",

src/partials/languages/zh.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"nav.title": "导航栏",
3737
"search.config.lang": "ja",
3838
"search.config.pipeline": "trimmer, stemmer",
39-
"search.config.separator": "[\\,\\。]+",
39+
"search.config.separator": "[\\s\\-,。]+",
4040
"search.placeholder": "搜索",
4141
"search.share": "分享",
4242
"search.reset": "清空当前内容",

0 commit comments

Comments
 (0)