diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-03 20:45:15 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-03 20:45:15 +0100 |
commit | 0796532460b90cb3ef7ecbf86db6d0adc07c88b4 (patch) | |
tree | f7f7d5a91a8cb40b1b4e83409905dddb7f27e56a /src/Wallabag/CoreBundle | |
parent | 74f39b0952440fa0c55e5e8a2e1a8d2bbd3acfd7 (diff) | |
download | wallabag-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 `&`.
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.twig | 28 |
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"><</small> 1 min</span></div> | 54 | {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}<small class="inferieur"><</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) }}…</p> | 59 | <p>{{ entry.content|striptags|slice(0, 300)|raw }}…</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"><</small> 1 min</span></div> | 72 | {% if entry.readingTime > 0 %}{{ entry.readingTime }}{% else %}<small class="inferieur"><</small> 1{% endif %} min |
72 | {% endif %} | 73 | </span> |
74 | </div> | ||
73 | 75 | ||
74 | <p>{{ entry.content|striptags|slice(0, 300) }}…</p> | 76 | <p>{{ entry.content|striptags|slice(0, 300)|raw }}…</p> |
75 | </div> | 77 | </div> |
76 | {% endif %} | 78 | {% endif %} |
77 | 79 | ||