From 1d2d558f186267b5263f8224cdf8c94e48d9e7ea Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 22 Jan 2021 11:51:22 -0800 Subject: jinja2: attempt to enable trans trimming by default Not sure this is actually working --- fatcat_scholar/web.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index 133ddce..010ad0d 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -158,6 +158,8 @@ def load_i18n_templates() -> Any: # remove a lot of whitespace in HTML output with these configs templates.env.trim_blocks = True templates.env.lstrip_blocks = True + # have {% trans %} blocks trim whitespace by default + templates.env.policies['ext.i18n.trimmed'] = True # pass-through application settings to be available in templates templates.env.globals["settings"] = settings d[lang_opt] = templates -- cgit v1.2.3