From f34b7a73d98a77db5b492c9a53fe8d520cda8279 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 12 Sep 2024 12:03:00 +0200 Subject: [PATCH] Don't use the deprecated spaceless filter --- src/Templates/default/html/figure.html.twig | 8 +------- src/Templates/default/html/link.html.twig | 2 -- src/Templates/default/html/toc-level.html.twig | 12 +++++------- src/Templates/default/html/toc.html.twig | 10 ++++------ tests/fixtures/expected/build-pdf/book.html | 4 ++-- tests/fixtures/expected/main/index.html | 2 +- tests/fixtures/expected/toctree/index.html | 10 +++++----- 7 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/Templates/default/html/figure.html.twig b/src/Templates/default/html/figure.html.twig index e1786c07..5836788a 100644 --- a/src/Templates/default/html/figure.html.twig +++ b/src/Templates/default/html/figure.html.twig @@ -1,12 +1,7 @@ {# Overridden to fix lack of figclass support (class attribute on +
{{ figureNode.image.render()|raw }} {% if figureNode.document %} @@ -17,4 +12,3 @@ Overridden to fix lack of figclass support (class attribute on -{% endapply %} diff --git a/src/Templates/default/html/link.html.twig b/src/Templates/default/html/link.html.twig index 8b9ca5ba..7c82a66e 100644 --- a/src/Templates/default/html/link.html.twig +++ b/src/Templates/default/html/link.html.twig @@ -1,5 +1,3 @@ -{% apply spaceless %} {% set domElement = attributes.domElement|default %} {% set class = (attributes.class|default ? attributes.class ~ ' ' : '') ~ 'reference ' ~ (('://' in url) ? 'external' : 'internal') %} key != 'domElement' and key != 'class') %} {{ key }}="{{ value }}"{% endfor %}>{% if domElement %}<{{ domElement }}>{% endif %}{{ title|raw }}{% if domElement %}{% endif %} -{% endapply %} diff --git a/src/Templates/default/html/toc-level.html.twig b/src/Templates/default/html/toc-level.html.twig index 1bdaef8d..8c3eb348 100644 --- a/src/Templates/default/html/toc-level.html.twig +++ b/src/Templates/default/html/toc-level.html.twig @@ -1,7 +1,5 @@ -{% apply spaceless %} -
    - {% for tocItem in tocItems %} - {% include "toc-item.html.twig" with { toc_deep_level: 1 } %} - {% endfor %} -
-{% endapply %} +
    + {% for tocItem in tocItems %} + {% include "toc-item.html.twig" with { toc_deep_level: 1 } %} + {% endfor %} +
diff --git a/src/Templates/default/html/toc.html.twig b/src/Templates/default/html/toc.html.twig index 55b87372..8b9c8836 100644 --- a/src/Templates/default/html/toc.html.twig +++ b/src/Templates/default/html/toc.html.twig @@ -1,6 +1,4 @@ -{% apply spaceless %} - {% set toc_options = toc_options(tocItems) %} -
- {% include "toc-level.html.twig" %} -
-{% endapply %} +{% set toc_options = toc_options(tocItems) %} +
+ {% include "toc-level.html.twig" %} +
diff --git a/tests/fixtures/expected/build-pdf/book.html b/tests/fixtures/expected/build-pdf/book.html index a2144636..4454f945 100644 --- a/tests/fixtures/expected/build-pdf/book.html +++ b/tests/fixtures/expected/build-pdf/book.html @@ -8,8 +8,8 @@

Book

Here is a link to the main index

diff --git a/tests/fixtures/expected/main/index.html b/tests/fixtures/expected/main/index.html index 13463739..628cc916 100644 --- a/tests/fixtures/expected/main/index.html +++ b/tests/fixtures/expected/main/index.html @@ -10,7 +10,7 @@

Some Test Docs!

- +

A header

diff --git a/tests/fixtures/expected/toctree/index.html b/tests/fixtures/expected/toctree/index.html index e07a28e7..676005ad 100644 --- a/tests/fixtures/expected/toctree/index.html +++ b/tests/fixtures/expected/toctree/index.html @@ -9,11 +9,11 @@