summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@cherry.de>2025-06-06 16:21:33 +0200
committerSteve Sakoman <steve@sakoman.com>2025-06-11 08:17:34 -0700
commita435aee8070c81d95bc798f0866f40c8b6092a5e (patch)
tree2341b054b95363526fcc6484af756eed5abf3789
parent82a79624617f57049f5d57858a6bf1c65ad6c975 (diff)
downloadpoky-scarthgap.tar.gz
docs: conf.py: silence SyntaxWarning on js_splitter_codescarthgap
The js_splitter_code string contains backslashes that Python tries to use as escape sequence but doesn't manage to, hence the following SyntaxWarning message: documentation/conf.py:188: SyntaxWarning: invalid escape sequence '\p' .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) Considering that we want this to be sent verbatim to the JS, let's make this a raw string instead. Fixes: d4a98ee19e0c ("conf.py: tweak SearchEnglish to be hyphen-friendly") (From yocto-docs rev: 6f424ed4ce749a135be3145a2e9d04030fdbda39) Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> (cherry picked from commit c1056672ef45b197136eb8815728d426337a5901) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--documentation/conf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/documentation/conf.py b/documentation/conf.py
index ad60d91139..1eca8756ab 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -182,7 +182,7 @@ class DashFriendlySearchEnglish(SearchEnglish):
182 # Accept words that can include hyphens 182 # Accept words that can include hyphens
183 _word_re = re.compile(r'[\w\-]+') 183 _word_re = re.compile(r'[\w\-]+')
184 184
185 js_splitter_code = """ 185 js_splitter_code = r"""
186function splitQuery(query) { 186function splitQuery(query) {
187 return query 187 return query
188 .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) 188 .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu)