diff options
author | Christian Hergert <chergert@redhat.com> | 2022-06-24 12:04:22 -0700 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2022-06-24 12:04:22 -0700 |
commit | 92016170d21d770c458315fa8d78f0eca0349394 (patch) | |
tree | e006fad2602b977845a37160079c49659576d5cf | |
parent | 37bf3d442b9832cd6ad00165db13f212532d7e4c (diff) | |
download | gtksourceview-92016170d21d770c458315fa8d78f0eca0349394.tar.gz |
tests: add syntax example for twig
This comes from some examples on https://twig.symfony.com/
-rw-r--r-- | tests/syntax-highlighting/file.twig | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/syntax-highlighting/file.twig b/tests/syntax-highlighting/file.twig new file mode 100644 index 00000000..cac141c9 --- /dev/null +++ b/tests/syntax-highlighting/file.twig @@ -0,0 +1,23 @@ +{{ var }} +{{ var|escape }} +{{ var|e }} {# shortcut to escape a variable #} + +{% for user in users %} + * {{ user.name }} +{% else %} + No users have been found. +{% endfor %} + +{% extends "layout.html" %} + +{% block content %} + Content of the page... +{% endblock %} + +{% autoescape "html" %} + {{ var }} + {{ var|raw }} {# var won't be escaped #} + {{ var|escape }} {# var won't be doubled-escaped #} +{% endautoescape %} + +{{ include('page.html', sandboxed = true) }} |