aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-02-03 20:45:15 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-02-03 20:45:15 +0100
commit0796532460b90cb3ef7ecbf86db6d0adc07c88b4 (patch)
treef7f7d5a91a8cb40b1b4e83409905dddb7f27e56a /src/Wallabag/CoreBundle
parent74f39b0952440fa0c55e5e8a2e1a8d2bbd3acfd7 (diff)
downloadwallabag-0796532460b90cb3ef7ecbf86db6d0adc07c88b4.tar.gz
wallabag-0796532460b90cb3ef7ecbf86db6d0adc07c88b4.tar.zst
wallabag-0796532460b90cb3ef7ecbf86db6d0adc07c88b4.zip
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 `&amp;`. Using |raw, the content isn't escape twice and is well displayed.
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig28
1 files 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 @@
46 <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i> 46 <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i>
47 {% endif %} 47 {% endif %}
48 48
49 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw|striptags|slice(0, 42) }}</a></span> 49 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
50 50
51 {% if entry.readingTime > 0 %} 51 <div class="estimatedTime grey-text">
52 <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time{% endtrans %}: {{ entry.readingTime }} min</span></div> 52 <span class="tool reading-time">
53 {% else %} 53 {% trans %}estimated reading time{% endtrans %}:
54 <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time{% endtrans %}: <small class="inferieur">&lt;</small> 1 min</span></div> 54 {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}<small class="inferieur">&lt;</small> 1{% endif %} min
55 {% endif %} 55 </span>
56 </div>
56 57
57 {% if entry.previewPicture is null %} 58 {% if entry.previewPicture is null %}
58 <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p> 59 <p>{{ entry.content|striptags|slice(0, 300)|raw }}&hellip;</p>
59 {% endif %} 60 {% endif %}
60 </div> 61 </div>
61 </div> 62 </div>
@@ -65,13 +66,14 @@
65 <i class="card-title grey-text text-darken-4 mdi-card-close right"></i> 66 <i class="card-title grey-text text-darken-4 mdi-card-close right"></i>
66 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span> 67 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span>
67 68
68 {% if entry.readingTime > 0 %} 69 <div class="estimatedTime grey-text">
69 <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time{% endtrans %}: {{ entry.readingTime }} min</span></div> 70 <span class="tool reading-time">
70 {% else %} 71 {% trans %}estimated reading time{% endtrans %}:
71 <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time{% endtrans %}: <small class="inferieur">&lt;</small> 1 min</span></div> 72 {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}<small class="inferieur">&lt;</small> 1{% endif %} min
72 {% endif %} 73 </span>
74 </div>
73 75
74 <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p> 76 <p>{{ entry.content|striptags|slice(0, 300)|raw }}&hellip;</p>
75 </div> 77 </div>
76 {% endif %} 78 {% endif %}
77 79