Projet

Général

Profil

0002-misc-add-space-inside-django-tags-in-skeletons-25706.patch

Frédéric Péters, 06 mars 2019 20:17

Télécharger (1,86 ko)

Voir les différences:

Subject: [PATCH 2/2] 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(-)
combo/public/templatetags/combo.py
120 120
        if token.contents == 'end_skeleton_extra_placeholder':
121 121
            break
122 122
        if token.token_type == TOKEN_VAR:
123
            text.append('{{')
123
            text.append('{{ ')
124 124
        elif token.token_type == TOKEN_BLOCK:
125
            text.append('{%')
125
            text.append('{% ')
126 126
        elif token.token_type == TOKEN_COMMENT:
127 127
            text.append('{# ')
128 128
        text.append(token.contents)
129 129
        if token.token_type == TOKEN_VAR:
130
            text.append('}}')
130
            text.append(' }}')
131 131
        elif token.token_type == TOKEN_BLOCK:
132
            text.append('%}')
132
            text.append(' %}')
133 133
        elif token.token_type == TOKEN_COMMENT:
134 134
            text.append(' #}')
135 135

  
tests/test_public.py
256 256
    assert 'Foobar' in resp.text
257 257

  
258 258
    # check {% now %} inside a skeleton_extra_placeholder is not interpreted
259
    assert '{%now' in resp.text
259
    assert '{% now ' in resp.text
260 260
    assert '{# generation time #}' in resp.text
261 261

  
262 262
    # check cells in footer are present even if there's no redirection page
263
-