From 33e65f7c70ad8b21ac27a76017cf9ab58ca30258 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sat, 14 May 2022 09:40:59 +0200 Subject: [PATCH] Fixed escape sequences on search separators --- docs/blog/2022/chinese-search-support.md | 2 +- docs/setup/setting-up-site-search.md | 4 ++-- docs/upgrade.md | 4 ++-- src/partials/languages/zh-Hant.html | 2 +- src/partials/languages/zh.html | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/blog/2022/chinese-search-support.md b/docs/blog/2022/chinese-search-support.md index 98a5ac9ff..a51146f2b 100644 --- a/docs/blog/2022/chinese-search-support.md +++ b/docs/blog/2022/chinese-search-support.md @@ -66,7 +66,7 @@ the [separator] includes the `\u200b` character: ``` yaml plugins: - search: - separator: '[\\s\\u200b\\-]' + separator: '[\s\u200b\-]' ``` That's all that is necessary. diff --git a/docs/setup/setting-up-site-search.md b/docs/setup/setting-up-site-search.md index 661638e61..47b66197c 100644 --- a/docs/setup/setting-up-site-search.md +++ b/docs/setup/setting-up-site-search.md @@ -108,7 +108,7 @@ The following configuration options are supported: ``` yaml plugins: - search: - separator: '[\\s\\-\\.]' # (1)! + separator: '[\s\-\.]' # (1)! ``` 1. Tokenization itself is carried out by [lunr's default tokenizer], which @@ -193,7 +193,7 @@ documents are tokenized: ``` yaml plugins: - search: - separator: "[\\s\\-,:!=\\[\\]()\"/]+|\\.(?!\\d)|&[lg]t;|(?!\\b)(?=[A-Z][a-z])" + separator: '[\s\-,:!=\[\]()"/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' ``` The following section explains what can be achieved with tokenizer lookahead: diff --git a/docs/upgrade.md b/docs/upgrade.md index 203fb9450..b0942b3d6 100644 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -1119,7 +1119,7 @@ was renamed to `separator`: ``` yaml plugins: - search: - separator: '[\\s\\-\\.]+' + separator: '[\s\-\.]+' lang: - en - de @@ -1132,7 +1132,7 @@ was renamed to `separator`: extra: search: language: en, de, ru - tokenizer: '[\\s\\-\\.]+' + tokenizer: '[\s\-\.]+' ``` [plugin options]: setup/setting-up-site-search.md#built-in-search-plugin diff --git a/src/partials/languages/zh-Hant.html b/src/partials/languages/zh-Hant.html index e95dff2da..b88107832 100644 --- a/src/partials/languages/zh-Hant.html +++ b/src/partials/languages/zh-Hant.html @@ -32,7 +32,7 @@ "meta.source": "來源", "search.config.lang": "ja", "search.config.pipeline": "trimmer, stemmer", - "search.config.separator": "[\\,\\。]+", + "search.config.separator": "[\\s\\-,。]+", "search.placeholder": "搜尋", "search.result.initializer": "正在初始化搜尋引擎", "search.result.placeholder": "鍵入以開始檢索", diff --git a/src/partials/languages/zh.html b/src/partials/languages/zh.html index fcd1d4990..6f59175ce 100644 --- a/src/partials/languages/zh.html +++ b/src/partials/languages/zh.html @@ -36,7 +36,7 @@ "nav.title": "导航栏", "search.config.lang": "ja", "search.config.pipeline": "trimmer, stemmer", - "search.config.separator": "[\\,\\。]+", + "search.config.separator": "[\\s\\-,。]+", "search.placeholder": "搜索", "search.share": "分享", "search.reset": "清空当前内容",