From 1bb7bdc8b399abe573dfa4e2c04fafa19991c487 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 1 Feb 2017 23:39:34 +0100 Subject: Fix rendering of entry title in Twig views This commit provides some improvements on the rendering of entry title on entries list and entry views and refactors filter calls: - Remove escape filter from apparent title, striptags is enough - Move raw filter to the end of apparent title as it's ignored if not placed as the last filter - Replace raw filter with e('html_attr') for title used in attributes, fixing possible issue and/or glitch - Add striptags to entry.title used for link sharing to respect the apparent title Fixes #2802 Signed-off-by: Kevin Decherf --- .../themes/material/Entry/_card_full_image.html.twig | 4 ++-- .../views/themes/material/Entry/_card_list.html.twig | 2 +- .../themes/material/Entry/_card_no_preview.html.twig | 4 ++-- .../themes/material/Entry/_card_preview.html.twig | 8 ++++---- .../views/themes/material/Entry/entry.html.twig | 20 ++++++++++---------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig index 91a1bac0..58757158 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig @@ -11,8 +11,8 @@
- - {{ entry.title | e | raw | striptags | truncate(80, true, '…') }} + + {{ entry.title | striptags | truncate(80, true, '…') | raw }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig index bb9b64ce..3ba6253a 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig @@ -2,7 +2,7 @@
- + {{ entry.title| striptags | truncate(120, true, '…') | raw }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig index ed916e79..eb158659 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig @@ -2,8 +2,8 @@
- - {{ entry.title | e | raw | striptags | truncate(80, true, '…') }} + + {{ entry.title | striptags | truncate(80, true, '…') | raw }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig index d23be4d0..fb5301c8 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig @@ -13,8 +13,8 @@ more_vert - - {{ entry.title | e | striptags | truncate(80, true, '…') | raw }} + + {{ entry.title | striptags | truncate(80, true, '…') | raw }} @@ -29,8 +29,8 @@
clear - - {{ entry.title | e | raw | striptags | truncate(80, true, '…') }} + + {{ entry.title | striptags | truncate(80, true, '…') | raw }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 15428b92..3e8da09c 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -1,6 +1,6 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} -{% block title %}{{ entry.title|e|raw }} ({{ entry.domainName|removeWww }}){% endblock %} +{% block title %}{{ entry.title|striptags|raw }} ({{ entry.domainName|removeWww }}){% endblock %} {% block body_class %}entry{% endblock %} @@ -118,14 +118,14 @@ {% endif %} {% if craue_setting('share_twitter') %}
  • - + twitter
  • {% endif %} {% if craue_setting('share_shaarli') %}
  • - + shaarli @@ -133,7 +133,7 @@ {% endif %} {% if craue_setting('share_diaspora') %}
  • - + diaspora* @@ -141,7 +141,7 @@ {% endif %} {% if craue_setting('share_unmark') %}
  • - + unmark.it @@ -149,7 +149,7 @@ {% endif %} {% if craue_setting('carrot') %}
  • - + Carrot @@ -157,7 +157,7 @@ {% endif %} {% if craue_setting('share_mail') %}
  • -
  • @@ -209,7 +209,7 @@ {% block content %}
    -

    {{ entry.title|e|raw }}

    +

    {{ entry.title|striptags|raw }}

    {% if entry.previewPicture is not null %} -
    {{ entry.title|raw }}
    +
    {{ entry.title|striptags|e('html_attr') }}
    {% endif %} -- cgit v1.2.3 From aedd385e108b1d8ae1473e840877086276172eeb Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Thu, 16 Feb 2017 21:36:34 +0100 Subject: views: cosmetic in share links href Signed-off-by: Kevin Decherf --- .../CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 3e8da09c..c3508083 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -133,7 +133,7 @@ {% endif %} {% if craue_setting('share_diaspora') %}
  • - + diaspora* @@ -149,7 +149,7 @@ {% endif %} {% if craue_setting('carrot') %}
  • - + Carrot -- cgit v1.2.3