HamlPy icon indicating copy to clipboard operation
HamlPy copied to clipboard

Support {% verbatim %} template tag as `- verbatim`

Open folz opened this issue 11 years ago • 2 comments

A template that uses the {% verbatim %} template tag as - verbatim raises a TemplateSyntaxError: "Unclosed tag 'verbatim'. Looking for one of: endverbatim."

Sample template that fails:

- verbatim
  %h1= page_title

Everything works if I wrap the block in non-Haml {% verbatim %} tags, like so:

{% verbatim %}
  %h1= page_title
{% endverbatim %}

Output:

<h1>{{ page_title }}</h1>

folz avatar Jun 25 '13 22:06 folz

It's easy enough to add:

from hamlpy import nodes as hamlpynodes
hamlpynodes.TagNode.self_closing.update(verbatim = endverbatim)

Naddiseo avatar Jul 03 '13 22:07 Naddiseo

But what about all other 3rd-party tags? - From https://pythonhosted.org/django-templateaddons/template_tags/assign.html for example.

maxvyaznikov avatar Apr 03 '15 15:04 maxvyaznikov