From 0e62602fbfca1cdda0e136c977be94fa8d44c492 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Wed, 1 Sep 2021 07:58:26 -0600 Subject: [PATCH] FIX: Use named params correctly with dir-span (#14203) --- app/assets/javascripts/discourse/app/helpers/dir-span.js | 2 +- .../discourse/app/templates/components/parent-category-row.hbs | 2 +- .../discourse/app/templates/components/sub-category-row.hbs | 2 +- .../javascripts/discourse/app/templates/list/topic-excerpt.hbr | 2 +- .../javascripts/discourse/app/templates/navigation/category.hbs | 2 +- .../select-kit/addon/templates/components/category-row.hbs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/helpers/dir-span.js b/app/assets/javascripts/discourse/app/helpers/dir-span.js index 20bcd5e15c..778f7c1126 100644 --- a/app/assets/javascripts/discourse/app/helpers/dir-span.js +++ b/app/assets/javascripts/discourse/app/helpers/dir-span.js @@ -16,7 +16,7 @@ function setDir(text) { export default registerUnbound("dir-span", function (str, params = {}) { let isHtmlSafe = false; if (params.htmlSafe) { - isHtmlSafe = params.htmlSafe; + isHtmlSafe = params.htmlSafe === "true"; } let text = isHtmlSafe ? str : escapeExpression(str); return htmlSafe(setDir(text)); diff --git a/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs b/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs index 3c82c0b60e..3bc57efd5b 100644 --- a/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/parent-category-row.hbs @@ -5,7 +5,7 @@ {{category-title-link category=category}} {{#if category.description_excerpt}}
- {{dir-span category.description_excerpt htmlSafe=true}} + {{dir-span category.description_excerpt htmlSafe="true"}}
{{/if}} {{#if category.isGrandParent}} diff --git a/app/assets/javascripts/discourse/app/templates/components/sub-category-row.hbs b/app/assets/javascripts/discourse/app/templates/components/sub-category-row.hbs index 6a0e30f75e..fd6126c997 100644 --- a/app/assets/javascripts/discourse/app/templates/components/sub-category-row.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/sub-category-row.hbs @@ -4,7 +4,7 @@ {{category-title-link tagName="h4" category=category}} {{#if category.description_excerpt}}
- {{dir-span category.description_excerpt htmlSafe=true}} + {{dir-span category.description_excerpt htmlSafe="true"}}
{{/if}} {{#if category.subcategories}} diff --git a/app/assets/javascripts/discourse/app/templates/list/topic-excerpt.hbr b/app/assets/javascripts/discourse/app/templates/list/topic-excerpt.hbr index 65114cef21..9cc03e9404 100644 --- a/app/assets/javascripts/discourse/app/templates/list/topic-excerpt.hbr +++ b/app/assets/javascripts/discourse/app/templates/list/topic-excerpt.hbr @@ -1,6 +1,6 @@ {{#if topic.hasExcerpt}} - {{dir-span topic.escapedExcerpt htmlSafe=true}} + {{dir-span topic.escapedExcerpt htmlSafe="true"}} {{#if topic.excerptTruncated}} {{i18n 'read_more'}} {{/if}} diff --git a/app/assets/javascripts/discourse/app/templates/navigation/category.hbs b/app/assets/javascripts/discourse/app/templates/navigation/category.hbs index e1f69c1008..3a7dd92fac 100644 --- a/app/assets/javascripts/discourse/app/templates/navigation/category.hbs +++ b/app/assets/javascripts/discourse/app/templates/navigation/category.hbs @@ -11,7 +11,7 @@ }} {{#if category.description}} -

{{dir-span category.description htmlSafe=true}}

+

{{dir-span category.description htmlSafe="true"}}

{{/if}} {{/if}} diff --git a/app/assets/javascripts/select-kit/addon/templates/components/category-row.hbs b/app/assets/javascripts/select-kit/addon/templates/components/category-row.hbs index a21bf862e7..fe948e880c 100644 --- a/app/assets/javascripts/select-kit/addon/templates/components/category-row.hbs +++ b/app/assets/javascripts/select-kit/addon/templates/components/category-row.hbs @@ -9,7 +9,7 @@ {{#if shouldDisplayDescription}} - + {{/if}} {{else}} {{html-safe label}}