mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
FIX: Use named params correctly with dir-span (#14203)
This commit is contained in:
parent
a2ca430068
commit
0e62602fbf
|
@ -16,7 +16,7 @@ function setDir(text) {
|
||||||
export default registerUnbound("dir-span", function (str, params = {}) {
|
export default registerUnbound("dir-span", function (str, params = {}) {
|
||||||
let isHtmlSafe = false;
|
let isHtmlSafe = false;
|
||||||
if (params.htmlSafe) {
|
if (params.htmlSafe) {
|
||||||
isHtmlSafe = params.htmlSafe;
|
isHtmlSafe = params.htmlSafe === "true";
|
||||||
}
|
}
|
||||||
let text = isHtmlSafe ? str : escapeExpression(str);
|
let text = isHtmlSafe ? str : escapeExpression(str);
|
||||||
return htmlSafe(setDir(text));
|
return htmlSafe(setDir(text));
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{{category-title-link category=category}}
|
{{category-title-link category=category}}
|
||||||
{{#if category.description_excerpt}}
|
{{#if category.description_excerpt}}
|
||||||
<div class="category-description">
|
<div class="category-description">
|
||||||
{{dir-span category.description_excerpt htmlSafe=true}}
|
{{dir-span category.description_excerpt htmlSafe="true"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if category.isGrandParent}}
|
{{#if category.isGrandParent}}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{category-title-link tagName="h4" category=category}}
|
{{category-title-link tagName="h4" category=category}}
|
||||||
{{#if category.description_excerpt}}
|
{{#if category.description_excerpt}}
|
||||||
<div class="category-description subcategory-description">
|
<div class="category-description subcategory-description">
|
||||||
{{dir-span category.description_excerpt htmlSafe=true}}
|
{{dir-span category.description_excerpt htmlSafe="true"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if category.subcategories}}
|
{{#if category.subcategories}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{#if topic.hasExcerpt}}
|
{{#if topic.hasExcerpt}}
|
||||||
<a href="{{topic.url}}" class="topic-excerpt">
|
<a href="{{topic.url}}" class="topic-excerpt">
|
||||||
{{dir-span topic.escapedExcerpt htmlSafe=true}}
|
{{dir-span topic.escapedExcerpt htmlSafe="true"}}
|
||||||
{{#if topic.excerptTruncated}}
|
{{#if topic.excerptTruncated}}
|
||||||
<span class="topic-excerpt-more">{{i18n 'read_more'}}</span>
|
<span class="topic-excerpt-more">{{i18n 'read_more'}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{#if category.description}}
|
{{#if category.description}}
|
||||||
<p>{{dir-span category.description htmlSafe=true}}</p>
|
<p>{{dir-span category.description htmlSafe="true"}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if shouldDisplayDescription}}
|
{{#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}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{html-safe label}}
|
{{html-safe label}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user