Skip to content

Commit

Permalink
Trim whitespace in newsfeed title
Browse files Browse the repository at this point in the history
  • Loading branch information
veeck committed May 24, 2023
1 parent 91065d6 commit 12d617c
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions modules/default/newsfeed/newsfeed.njk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% macro escapeText(text, dangerouslyDisableAutoEscaping=false) %}
{% if dangerouslyDisableAutoEscaping %}
{% if dangerouslyDisableAutoEscaping -%}
{{ text | safe }}
{% else %}
{%- else -%}
{{ text }}
{% endif %}
{%- endif %}
{% endmacro %}
{% macro escapeTitle(title, url, dangerouslyDisableAutoEscaping=false, showTitleAsUrl=false) %}
{% if dangerouslyDisableAutoEscaping %}
Expand Down Expand Up @@ -34,12 +34,7 @@
{% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
<div class="newsfeed-source light small dimmed">
{% if item.sourceTitle and config.showSourceTitle %}
{{ item.sourceTitle }}
{% if config.showPublishDate %}
,
{% else %}
:
{% endif %}
{{ item.sourceTitle }}{% if config.showPublishDate %}, {% else %}:{% endif %}
{% endif %}
{% if config.showPublishDate %}{{ item.publishDate }}:{% endif %}
</div>
Expand All @@ -64,12 +59,7 @@
{% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
<div class="newsfeed-source light small dimmed">
{% if sourceTitle and config.showSourceTitle %}
{{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}
{% if config.showPublishDate %}
,
{% else %}
:
{% endif %}
{{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %}, {% else %}:{% endif %}
{% endif %}
{% if config.showPublishDate %}{{ publishDate }}:{% endif %}
</div>
Expand Down

0 comments on commit 12d617c

Please sign in to comment.