Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

makemessages: Fix handling of handlebars whitespace control.

Tim Abbottbcff5580d158
diff --git a/zerver/management/commands/makemessages.py b/zerver/management/commands/makemessages.py
index 88c30dbb204..2c2ace6f3d1 100644
--- a/zerver/management/commands/makemessages.py
+++ b/zerver/management/commands/makemessages.py
@@ -52,9 +52,9 @@ strip_whitespace_left = re.compile(
)
regexes = [
- r"{{#tr}}([\s\S]*?)(?:{{/tr}}|{{#\*inline )", # '.' doesn't match '\n' by default
- r'{{\s*t "([\s\S]*?)"\W*}}',
- r"{{\s*t '([\s\S]*?)'\W*}}",
+ r"{{~?#tr}}([\s\S]*?)(?:~?{{/tr}}|{{#\*inline )", # '.' doesn't match '\n' by default
+ r'{{~?\s*t "([\s\S]*?)"\W*~?}}',
+ r"{{~?\s*t '([\s\S]*?)'\W*~?}}",
r'\(t "([\s\S]*?)"\)',
r'=\(t "([\s\S]*?)"\)(?=[^{]*}})',
r"=\(t '([\s\S]*?)'\)(?=[^{]*}})",