From 0796532460b90cb3ef7ecbf86db6d0adc07c88b4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 3 Feb 2016 20:45:15 +0100 Subject: [PATCH] Unescape content for Material card Using slice & striptags, the content is automatically escaped. If some html character need to be displayed, they'll be escape too, sth like `&`. Using |raw, the content isn't escape twice and is well displayed. --- .../themes/material/Entry/entries.html.twig | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 6de800b9..0c35de2d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -46,16 +46,17 @@ {% endif %} - {{ entry.title|raw|striptags|slice(0, 42) }} + {{ entry.title|striptags|slice(0, 42)|raw }} - {% if entry.readingTime > 0 %} -
{% trans %}estimated reading time{% endtrans %}: {{ entry.readingTime }} min
- {% else %} -
{% trans %}estimated reading time{% endtrans %}: < 1 min
- {% endif %} +
+ + {% trans %}estimated reading time{% endtrans %}: + {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}< 1{% endif %} min + +
{% if entry.previewPicture is null %} -

{{ entry.content|striptags|slice(0, 300) }}…

+

{{ entry.content|striptags|slice(0, 300)|raw }}…

{% endif %} @@ -65,13 +66,14 @@ {{ entry.title|raw }} - {% if entry.readingTime > 0 %} -
{% trans %}estimated reading time{% endtrans %}: {{ entry.readingTime }} min
- {% else %} -
{% trans %}estimated reading time{% endtrans %}: < 1 min
- {% endif %} +
+ + {% trans %}estimated reading time{% endtrans %}: + {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}< 1{% endif %} min + +
-

{{ entry.content|striptags|slice(0, 300) }}…

+

{{ entry.content|striptags|slice(0, 300)|raw }}…

{% endif %} -- 2.41.0