Support for the kind in the endblock

Example:
{% block css %}
... some other stuff
{% endblock css %}

Instead of (both are supported):
{% block css %}
... some other stuff
{% endblock %}
This commit is contained in:
WoLpH
2013-11-19 19:12:01 +01:00
parent c961dadf6e
commit 864e71817e

View File

@@ -29,6 +29,10 @@ class CompressorExtension(CompressorMixin, Extension):
else:
args.append(nodes.Const('file'))
body = parser.parse_statements(['name:endcompress'], drop_needle=True)
# Skip the kind if used in the endblock, by using the kind in the
# endblock the templates are slightly more readable.
parser.stream.skip_if('name:' + kindarg.value)
return nodes.CallBlock(self.call_method('_compress', args), [], [],
body).set_lineno(lineno)