Skip to content

A platform for community discussion. Free, open, simple.

FIX: Use named params correctly with dir-span (#14203)

Blake Erickson0e62602fbfca
diff --git a/app/assets/javascripts/discourse/app/helpers/dir-span.js b/app/assets/javascripts/discourse/app/helpers/dir-span.js
index 20bcd5e15ca..778f7c11267 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 3c82c0b60e6..3bc57efd5b9 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}}
<div class="category-description">
- {{dir-span category.description_excerpt htmlSafe=true}}
+ {{dir-span category.description_excerpt htmlSafe="true"}}
</div>
{{/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 6a0e30f75ef..fd6126c9970 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}}
<div class="category-description subcategory-description">
- {{dir-span category.description_excerpt htmlSafe=true}}
+ {{dir-span category.description_excerpt htmlSafe="true"}}
</div>
{{/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 65114cef21f..9cc03e94047 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}}
<a href="{{topic.url}}" class="topic-excerpt">
- {{dir-span topic.escapedExcerpt htmlSafe=true}}
+ {{dir-span topic.escapedExcerpt htmlSafe="true"}}
{{#if topic.excerptTruncated}}
<span class="topic-excerpt-more">{{i18n 'read_more'}}</span>
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/templates/navigation/category.hbs b/app/assets/javascripts/discourse/app/templates/navigation/category.hbs
index e1f69c1008c..3a7dd92fac5 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}}
- <p>{{dir-span category.description htmlSafe=true}}</p>
+ <p>{{dir-span category.description htmlSafe="true"}}</p>
{{/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 a21bf862e70..fe948e880c0 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 @@
</div>
{{#if shouldDisplayDescription}}
- <div class="category-desc" aria-hidden="true">{{dir-span description htmlSafe=true}}</div>
+ <div class="category-desc" aria-hidden="true">{{dir-span description htmlSafe="true"}}</div>
{{/if}}
{{else}}
{{html-safe label}}