From: Jeremy Benoist Date: Wed, 3 Feb 2016 19:45:15 +0000 (+0100) Subject: Unescape content for Material card X-Git-Tag: 2.0.0-beta.1~55^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=0796532460b90cb3ef7ecbf86db6d0adc07c88b4;p=github%2Fwallabag%2Fwallabag.git 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. --- 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 %}