From a03b9e6906b68bd38db4d6b18652957746e2c7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 6 Mar 2019 20:16:28 +0100 Subject: [PATCH] misc: add space inside django tags in skeletons (#25706) --- combo/public/templatetags/combo.py | 8 ++++---- tests/test_public.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/combo/public/templatetags/combo.py b/combo/public/templatetags/combo.py index 92853d1b..15d0cd19 100644 --- a/combo/public/templatetags/combo.py +++ b/combo/public/templatetags/combo.py @@ -120,16 +120,16 @@ def skeleton_extra_placeholder(parser, token): if token.contents == 'end_skeleton_extra_placeholder': break if token.token_type == TOKEN_VAR: - text.append('{{') + text.append('{{ ') elif token.token_type == TOKEN_BLOCK: - text.append('{%') + text.append('{% ') elif token.token_type == TOKEN_COMMENT: text.append('{# ') text.append(token.contents) if token.token_type == TOKEN_VAR: - text.append('}}') + text.append(' }}') elif token.token_type == TOKEN_BLOCK: - text.append('%}') + text.append(' %}') elif token.token_type == TOKEN_COMMENT: text.append(' #}') diff --git a/tests/test_public.py b/tests/test_public.py index 561d94d3..fc9da15d 100644 --- a/tests/test_public.py +++ b/tests/test_public.py @@ -256,7 +256,7 @@ def test_page_skeleton(app): assert 'Foobar' in resp.text # check {% now %} inside a skeleton_extra_placeholder is not interpreted - assert '{%now' in resp.text + assert '{% now ' in resp.text assert '{# generation time #}' in resp.text # check cells in footer are present even if there's no redirection page