You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Twig, anything between a {% verbatim %} tag and its following {% endverbatim %} tag is not parsed as Twig, but is part of the output as is. But the Twig syntax highlighter will still highlight Twig markup inside it.
The definition of this behavior also implies that you cannot nest a verbatim tag into another one:
{{ 'start'|title }}
{% verbatim %}
hello {{ world }}
{# that's not a Twig comment, and next line does not start a verbatim tag but writes such text #}
{% verbatim %} that's just output {% endverbatim %}
{{ 'that\'s actually Twig markup again here' }}
{# that one is a syntax error, as the only actual verbatim tag opened at the start ended above #}
{% endverbatim %}
Note that in Twig 1.x, there was a {% raw %}/{% endraw %} tag with the same behavior (start and end tag had to match), which was deprecated and does not exist anymore in Twig 2.x. I'm not sure whether you want to support it.
The text was updated successfully, but these errors were encountered:
Jinja provides a `raw` tag and Twig provides a `raw` tag in its
1.x version and a `verbatim` one in newer versions. Since the Twig
lexer extends from the Jinja one, the latter holds the logic for
both tags. This fixes#982 and fixes#983.
In Twig, anything between a
{% verbatim %}
tag and its following{% endverbatim %}
tag is not parsed as Twig, but is part of the output as is. But the Twig syntax highlighter will still highlight Twig markup inside it.The definition of this behavior also implies that you cannot nest a verbatim tag into another one:
Note that in Twig 1.x, there was a
{% raw %}
/{% endraw %}
tag with the same behavior (start and end tag had to match), which was deprecated and does not exist anymore in Twig 2.x. I'm not sure whether you want to support it.The text was updated successfully, but these errors were encountered: