From 4549ff19aaaab09060b4ed4c4aab062fc2213598 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Fri, 6 Jun 2025 16:21:33 +0200 Subject: docs: conf.py: silence SyntaxWarning on js_splitter_code 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: c1056672ef45b197136eb8815728d426337a5901) Signed-off-by: Quentin Schulz Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- documentation/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): # Accept words that can include hyphens _word_re = re.compile(r'[\w\-]+') - js_splitter_code = """ + js_splitter_code = r""" function splitQuery(query) { return query .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) -- cgit v1.2.3-54-g00ecf