diff --git a/docs/setup/setting-up-site-search.md b/docs/setup/setting-up-site-search.md index cb77ec600..739db009e 100644 --- a/docs/setup/setting-up-site-search.md +++ b/docs/setup/setting-up-site-search.md @@ -102,7 +102,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 @@ -186,7 +186,7 @@ documents are tokenized: ``` yaml plugins: - search: - separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;' + 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 b0942b3d6..203fb9450 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/material/partials/languages/zh-Hant.html b/material/partials/languages/zh-Hant.html index 6445f0aa7..ecc06bd73 100644 --- a/material/partials/languages/zh-Hant.html +++ b/material/partials/languages/zh-Hant.html @@ -12,7 +12,7 @@ "meta.source": "來源", "search.config.lang": "ja", "search.config.pipeline": "trimmer, stemmer", - "search.config.separator": "[\,\。]+", + "search.config.separator": "[\\,\\。]+", "search.placeholder": "搜尋", "search.result.initializer": "正在初始化搜尋引擎", "search.result.placeholder": "鍵入以開始檢索", diff --git a/material/partials/languages/zh.html b/material/partials/languages/zh.html index fc396eb8d..bbc01ae87 100644 --- a/material/partials/languages/zh.html +++ b/material/partials/languages/zh.html @@ -16,7 +16,7 @@ "nav.title": "导航栏", "search.config.lang": "ja", "search.config.pipeline": "trimmer, stemmer", - "search.config.separator": "[\,\。]+", + "search.config.separator": "[\\,\\。]+", "search.placeholder": "搜索", "search.share": "分享", "search.reset": "清空当前内容", diff --git a/src/partials/languages/zh-Hant.html b/src/partials/languages/zh-Hant.html index c246b391e..e95dff2da 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": "[\\,\\。]+", "search.placeholder": "搜尋", "search.result.initializer": "正在初始化搜尋引擎", "search.result.placeholder": "鍵入以開始檢索", diff --git a/src/partials/languages/zh.html b/src/partials/languages/zh.html index eebcd1a74..fcd1d4990 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": "[\\,\\。]+", "search.placeholder": "搜索", "search.share": "分享", "search.reset": "清空当前内容",