Skip to content

Commit

Permalink
Merge pull request #130 from javiereguiluz/twig_3
Browse files Browse the repository at this point in the history
Allow using Twig 3
  • Loading branch information
greg0ire authored Mar 2, 2021
2 parents da8784a + cccfd0f commit 24f905c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "^7.1 || ^8.0",
"symfony/filesystem": "^4.1 || ^5.0",
"symfony/finder": "^4.1 || ^5.0",
"twig/twig": "^2.5",
"twig/twig": "^2.9 || ^3.3",
"doctrine/event-manager": "^1.0"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions lib/Templates/default/html/definition-list.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% spaceless %}
{% apply spaceless %}
<dl{% if definitionListNode.classes %} class="{{ definitionListNode.classesString }}"{% endif %}>
{% for definitionListTerm in definitionList.terms %}
{% if definitionListTerm.classifiers is empty %}
Expand Down Expand Up @@ -31,4 +31,4 @@
{% endif %}
{% endfor %}
</dl>
{% endspaceless %}
{% endapply %}
4 changes: 2 additions & 2 deletions lib/Templates/default/html/figure.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% spaceless %}
{% apply spaceless %}
<figure>
{{ figureNode.image.render()|raw }}

Expand All @@ -10,4 +10,4 @@
{% endif %}
{% endif %}
</figure>
{% endspaceless %}
{% endapply %}
4 changes: 2 additions & 2 deletions lib/Templates/default/html/paragraph.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% spaceless %}
{% apply spaceless %}
{% set text = paragraphNode.value.render()|trim %}

{% if text %}
<p{% if paragraphNode.classes %} class="{{ paragraphNode.classesString }}"{% endif %}>{{ text|raw }}</p>
{% endif %}
{% endspaceless %}
{% endapply %}
4 changes: 2 additions & 2 deletions lib/Templates/default/html/toc-level.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% spaceless %}
{% apply spaceless %}
<ul>
{% for tocItem in tocItems %}
{% include "toc-item.html.twig" %}
{% endfor %}
</ul>
{% endspaceless %}
{% endapply %}
4 changes: 2 additions & 2 deletions lib/Templates/default/html/toc.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% spaceless %}
{% apply spaceless %}
<div class="toc">
{% include "toc-level.html.twig" %}
</div>
{% endspaceless %}
{% endapply %}
4 changes: 2 additions & 2 deletions lib/Templates/default/tex/paragraph.tex.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% spaceless %}
{% apply spaceless %}
{% set text = paragraphNode.value.render() %}

{% if text|trim %}
{{ text|raw }}

{% endif %}
{% endspaceless %}
{% endapply %}

0 comments on commit 24f905c

Please sign in to comment.