DEV: enforces ember-template-lint: no-triple-curlies (#9165)

This pr replaces `{{{ }}}` usage by a {{html-safe}} helper. While it doesn't solve the underlying issue, it gives us a path forward without risking breaking too much existing behavior.

Also introduces an htmlSafe computed macro:

```
import { htmlSafe } from "discourse/lib/computed";

htmlDescription: htmlSafe("description")
```

Overtime {{html-safe}} usage should be removed and moved to components properties or specialized components/helpers.
This commit is contained in:
Joffrey JAFFEUX 2020-03-11 09:23:10 +01:00 committed by GitHub
parent 1f34f653bf
commit 683cb28099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
150 changed files with 337 additions and 276 deletions

View File

@ -11,6 +11,7 @@ module.exports = {
"no-unnecessary-concat": true,
"no-unused-block-params": true,
"no-unbound": true,
"simple-unless": true
"simple-unless": true,
"no-triple-curlies": true
}
};

View File

@ -9,11 +9,11 @@
{{icon-or-image model}}
<span class="badge-display-name">{{model.name}}</span>
{{else}}
<span class='badge-placeholder'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
<span class='badge-placeholder'>{{i18n 'admin.badges.mass_award.no_badge_selected'}}</span>
{{/if}}
</div>
<div>
<h4>{{I18n 'admin.badges.mass_award.upload_csv'}}</h4>
<h4>{{i18n 'admin.badges.mass_award.upload_csv'}}</h4>
<input type='file' id='massAwardCSVUpload' accept='.csv'>
</div>
<div>
@ -34,6 +34,6 @@
{{/link-to}}
</form>
{{else}}
<span class='badge-required'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
<span class='badge-required'>{{i18n 'admin.badges.mass_award.no_badge_selected'}}</span>
{{/if}}
{{/d-section}}

View File

@ -7,7 +7,7 @@
{{#each badgeIntroLinks as |link|}}
<a href={{link.href}} class="external-link" target="_blank" rel="noopener">
{{d-icon link.icon}}
<span>{{I18n link.text}}</span>
<span>{{i18n link.text}}</span>
</a>
{{/each}}
</div>

View File

@ -15,7 +15,7 @@
{{#if backupStats.last_backup_taken_at}}
<br>
{{{i18n "admin.dashboard.lastest_backup" date=(format-date backupStats.last_backup_taken_at leaveAgo="true")}}}
{{i18n "admin.dashboard.lastest_backup" date=(format-date backupStats.last_backup_taken_at leaveAgo="true")}}
{{/if}}
</p>
</div>

View File

@ -1 +1 @@
{{{formatedValue}}}
{{html-safe formatedValue}}

View File

@ -199,6 +199,6 @@
{{/conditional-loading-section}}
{{else}}
<div class="alert alert-info">
{{{disabledLabel}}}
{{html-safe disabledLabel}}
</div>
{{/if}}

View File

@ -46,7 +46,7 @@
<div class="form-display">
<strong>{{userField.name}}</strong>
<br>
{{{userField.description}}}
{{html-safe userField.description}}
</div>
<div class="form-display">{{fieldName}}</div>
<div class="form-element controls">

View File

@ -1,7 +1,7 @@
<div class='penalty-post-controls'>
<label>
<div class='penalty-post-label'>
{{{i18n 'admin.user.penalty_post_actions'}}}
{{i18n 'admin.user.penalty_post_actions'}}
</div>
</label>
{{combo-box

View File

@ -1,7 +1,7 @@
<div class='reason-controls'>
<label>
<div class='silence-reason-label'>
{{{i18n 'admin.user.silence_reason_label'}}}
{{i18n 'admin.user.silence_reason_label'}}
</div>
</label>
{{text-field

View File

@ -1,5 +1,5 @@
<label>
{{input type="checkbox" checked=enabled}}
<span>{{{setting.description}}}</span>
<span>{{html-safe setting.description}}</span>
{{setting-validation-message message=validationMessage}}
</label>

View File

@ -3,5 +3,5 @@
onChange=(action "onChangeSelectedCategories")
}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>
{{setting-validation-message message=validationMessage}}

View File

@ -4,4 +4,4 @@
onChange=(action (mut value))
}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -6,4 +6,4 @@
onChangeColor=(action "onChangeColor")
}}
{{setting-validation-message message=validationMessage}}
<div class="desc">{{{setting.description}}}</div>
<div class="desc">{{html-safe setting.description}}</div>

View File

@ -8,4 +8,4 @@
}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -15,5 +15,5 @@
{{setting-validation-message message=validationMessage}}
<div class='desc'>
{{{setting.description}}}
{{html-safe setting.description}}
</div>

View File

@ -7,4 +7,4 @@
onChange=(action "onChangeGroupListSetting")
}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{value-list values=value addKey="admin.site_settings.add_host"}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{value-list values=value inputDelimiter="|" choices=setting.choices}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{secret-value-list setting=setting values=value isSecret=isSecret}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -7,4 +7,4 @@
{{/if}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{tag-chooser tags=selectedTags}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>
{{setting-validation-message message=validationMessage}}

View File

@ -1,2 +1,2 @@
{{site-settings-image-uploader imageUrl=value placeholderUrl=setting.placeholder type="site_setting"}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,2 +1,2 @@
{{d-button label="admin.site_settings.uploaded_image_list.label" action=(action "showUploadModal") actionParam=(hash value=value setting=setting)}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{value-list values=value addKey="admin.site_settings.add_url"}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -1,3 +1,3 @@
{{value-list values=value}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{setting.description}}}</div>
<div class='desc'>{{html-safe setting.description}}</div>

View File

@ -2,9 +2,9 @@
<label>
<div class='suspend-reason-label'>
{{#if siteSettings.hide_suspension_reasons}}
{{{i18n 'admin.user.suspend_reason_hidden_label'}}}
{{i18n 'admin.user.suspend_reason_hidden_label'}}
{{else}}
{{{i18n 'admin.user.suspend_reason_label'}}}
{{i18n 'admin.user.suspend_reason_label'}}
{{/if}}
</div>
</label>

View File

@ -28,14 +28,14 @@
{{#if displayComponents}}
<div class="components-list">
<span class="components">{{{childrenString}}}</span>
<span class="components">{{html-safe childrenString}}</span>
{{#if displayHasMore}}
<a href {{action "toggleChildrenExpanded"}} class="others-count">
{{#if childrenExpanded}}
{{I18n "admin.customize.theme.collapse"}}
{{i18n "admin.customize.theme.collapse"}}
{{else}}
{{I18n "admin.customize.theme.and_x_more" count=moreCount}}
{{i18n "admin.customize.theme.and_x_more" count=moreCount}}
{{/if}}
</a>
{{/if}}

View File

@ -25,9 +25,9 @@
<div class="themes-list-item inactive-indicator">
<span class="empty">
{{#if themesTabActive}}
{{I18n "admin.customize.theme.inactive_themes"}}
{{i18n "admin.customize.theme.inactive_themes"}}
{{else}}
{{I18n "admin.customize.theme.inactive_components"}}
{{i18n "admin.customize.theme.inactive_components"}}
{{/if}}
</span>
</div>
@ -41,7 +41,7 @@
{{/if}}
{{else}}
<div class="themes-list-item">
<span class="empty">{{I18n "admin.customize.theme.empty"}}</span>
<span class="empty">{{i18n "admin.customize.theme.empty"}}</span>
</div>
{{/if}}

View File

@ -1,7 +1,7 @@
<div class="themes-intro admin-intro">
<img src={{womanArtistEmojiURL}}>
<div class="content-wrapper">
<h1>{{I18n "admin.customize.theme.themes_intro"}}</h1>
<h1>{{i18n "admin.customize.theme.themes_intro"}}</h1>
<div class="create-actions">
{{d-button action=(route-action "installModal") icon="upload" label="admin.customize.install" class="btn-primary"}}
</div>
@ -9,7 +9,7 @@
{{#each externalResources as |resource|}}
<a href={{resource.link}} class="external-link" rel="noopener" target="_blank">
{{d-icon resource.icon}}
{{I18n resource.key}}
{{i18n resource.key}}
</a>
{{/each}}
</div>

View File

@ -89,7 +89,7 @@
{{#if showRemoteError}}
<div class="error-message">
{{d-icon "exclamation-triangle"}} {{I18n "admin.customize.theme.repo_unreachable"}}
{{d-icon "exclamation-triangle"}} {{i18n "admin.customize.theme.repo_unreachable"}}
</div>
<div class="raw-error">
<code>{{model.remoteError}}</code>

View File

@ -12,7 +12,7 @@
<div class="problem-messages">
<ul>
{{#each problems as |problem|}}
<li>{{{problem}}}</li>
<li>{{html-safe problem}}</li>
{{/each}}
</ul>
</div>

View File

@ -142,7 +142,7 @@
filters=trendingSearchFilters
isEnabled=logSearchQueriesEnabled
disabledLabel=trendingSearchDisabledLabel}}
{{{i18n "admin.dashboard.reports.trending_search.more" basePath=basePath}}}
{{i18n "admin.dashboard.reports.trending_search.more" basePath=basePath}}
</div>
</div>

View File

@ -14,13 +14,13 @@
<hr>
<div class="text">
<h3>{{i18n 'admin.email.advanced_test.text'}}</h3>
<pre class="full-reason">{{{text}}}</pre>
<pre class="full-reason">{{html-safe text}}</pre>
</div>
<hr>
<div class="elided">
<h3>{{i18n 'admin.email.advanced_test.elided'}}</h3>
<pre class="full-reason">{{{elided}}}</pre>
<pre class="full-reason">{{html-safe elided}}</pre>
</div>
{{/if}}

View File

@ -53,7 +53,7 @@
<iframe srcdoc={{model.html_content}} />
{{/if}}
{{else}}
<pre>{{{model.text_content}}}</pre>
<pre>{{html-safe model.text_content}}</pre>
{{/if}}
</div>
</div>

View File

@ -23,7 +23,7 @@
{{#if showSecondary}}
<div class='embedding-secondary'>
<p>{{{i18n "admin.embedding.sample"}}}</p>
<p>{{i18n "admin.embedding.sample"}}</p>
{{highlighted-code code=embeddingCode lang="html"}}
</div>

View File

@ -88,7 +88,7 @@
<td class="col value created-at">{{age-with-tooltip item.created_at}}</td>
<td class="col value details">
<div>
{{{item.formattedDetails}}}
{{html-safe item.formattedDetails}}
{{#if item.useCustomModalForDetails}}
<a href {{action "showCustomDetailsModal" item}}>{{d-icon "info-circle"}} {{i18n 'admin.logs.staff_actions.show'}}</a>
{{/if}}

View File

@ -17,9 +17,9 @@
{{else}}
<p class="grant-count">
{{#if count}}
{{{i18n "admin.badges.preview.grant_count" count=count}}}
{{i18n "admin.badges.preview.grant_count" count=count}}
{{else}}
{{{i18n "admin.badges.preview.no_grant_count"}}}
{{i18n "admin.badges.preview.no_grant_count"}}
{{/if}}
</p>
@ -41,14 +41,14 @@
</p>
<ul>
{{#each processedSample as |html|}}
<li>{{{html}}}</li>
<li>{{html-safe html}}</li>
{{/each}}
</ul>
{{/if}}
{{#if hasQueryPlan}}
<div class="badge-query-plan">
{{{queryPlanHtml}}}
{{html-safe queryPlanHtml}}
</div>
{{/if}}
{{/if}}

View File

@ -24,7 +24,7 @@
<div class="popular-theme-buttons">
{{#if theme.installed}}
<span>{{I18n "admin.customize.theme.installed"}}</span>
<span>{{i18n "admin.customize.theme.installed"}}</span>
{{else}}
{{d-button class='btn-small'
label="admin.customize.theme.install"
@ -33,7 +33,7 @@
action=(action "installThemeFromList" theme.value)}}
{{#if theme.preview}}
<a href={{theme.preview}} rel="noopener" target="_blank">{{d-icon "desktop"}} {{I18n "admin.customize.theme.preview"}}</a>
<a href={{theme.preview}} rel="noopener" target="_blank">{{d-icon "desktop"}} {{i18n "admin.customize.theme.preview"}}</a>
{{/if}}
{{/if}}
</div>
@ -85,10 +85,10 @@
{{#if create}}
<div class="inputs">
<div class="label">{{I18n "admin.customize.theme.create_name"}}</div>
<div class="label">{{i18n "admin.customize.theme.create_name"}}</div>
{{input value=name placeholder=placeholder}}
<div class="label">{{I18n "admin.customize.theme.create_type"}}</div>
<div class="label">{{i18n "admin.customize.theme.create_type"}}</div>
{{combo-box
valueProperty="value"
content=createTypes

View File

@ -1,6 +1,6 @@
<div>
{{#d-modal-body title="admin.logs.staff_actions.modal_title"}}
{{{diff}}}
{{html-safe diff}}
{{/d-modal-body}}
<div class="modal-footer">
{{d-button

View File

@ -7,7 +7,7 @@
</div>
<div class="popular-theme-buttons">
{{#if theme.installed}}
<span>{{I18n "admin.customize.theme.installed"}}</span>
<span>{{i18n "admin.customize.theme.installed"}}</span>
{{else}}
{{d-button class='btn-small'
label="admin.customize.theme.install"

View File

@ -31,7 +31,7 @@
<div class='fps-topic'>
<div class='topic'>
<a class='search-link' href={{result.url}}>
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=term}}{{{result.topic.fancyTitle}}}{{/highlight-text}}</span>
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=term}}{{html-safe result.topic.fancyTitle}}{{/highlight-text}}</span>
</a>
<div class='search-category'>
@ -55,7 +55,7 @@
{{#if result.blurb}}
{{#highlight-text highlight=term}}
{{{result.blurb}}}
{{html-safe result.blurb}}
{{/highlight-text}}
{{/if}}
</div>

View File

@ -132,7 +132,7 @@
<div class="field">{{i18n "user.avatar.title"}}</div>
<div class="value">{{avatar model imageSize="large"}}</div>
<div class="controls">
{{{i18n "admin.user.visit_profile" url=preferencesPath}}}
{{i18n "admin.user.visit_profile" url=preferencesPath}}
</div>
</div>
@ -509,7 +509,7 @@
<h1>{{i18n "admin.groups.title"}}</h1>
<div class="display-row">
<div class="field">{{i18n "admin.groups.automatic"}}</div>
<div class="value">{{{automaticGroups}}}</div>
<div class="value">{{html-safe automaticGroups}}</div>
</div>
<div class="display-row">
<div class="field">{{i18n "admin.groups.custom"}}</div>
@ -616,11 +616,11 @@
</div>
<div class="display-row">
<div class="field">{{i18n "admin.user.time_read"}}</div>
<div class="value">{{{format-duration model.time_read}}}</div>
<div class="value">{{format-duration model.time_read}}</div>
</div>
<div class="display-row">
<div class="field">{{i18n "user.invited.days_visited"}}</div>
<div class="value">{{{model.days_visited}}}</div>
<div class="value">{{html-safe model.days_visited}}</div>
</div>
</section>

View File

@ -53,11 +53,11 @@
</td>
<td class="last-emailed">
<div class="label">{{i18n 'admin.users.last_emailed'}}</div>
<div>{{{format-duration user.last_emailed_age}}}</div>
<div>{{format-duration user.last_emailed_age}}</div>
</td>
<td class="last-seen">
<div class="label">{{i18n 'last_seen'}}</div>
<div>{{{format-duration user.last_seen_age}}}</div>
<div>{{format-duration user.last_seen_age}}</div>
</td>
<td class="topics-entered">
<div class="label">{{i18n 'admin.user.topics_entered'}}</div>
@ -69,12 +69,12 @@
</td>
<td class="time-read">
<div class="label">{{i18n 'admin.user.time_read'}}</div>
<div>{{{format-duration user.time_read}}}</div>
<div>{{format-duration user.time_read}}</div>
</td>
<td class="created">
<div class="label">{{i18n 'created'}}</div>
<div>{{{format-duration user.created_at_age}}}</div>
<div>{{format-duration user.created_at_age}}</div>
</td>
{{#if siteSettings.must_approve_users}}

View File

@ -0,0 +1,6 @@
import { registerUnbound } from "discourse-common/lib/helpers";
import { htmlSafe } from "@ember/template";
registerUnbound("html-safe", function(string) {
return htmlSafe(string);
});

View File

@ -1,6 +1,7 @@
import { registerUnbound } from "discourse-common/lib/helpers";
import { htmlSafe } from "@ember/template";
registerUnbound("i18n", (key, params) => I18n.t(key, params));
registerUnbound("i18n", (key, params) => htmlSafe(I18n.t(key, params)));
registerUnbound("i18n-yes-no", (value, params) =>
I18n.t(value ? "yes_value" : "no_value", params)
);

View File

@ -1,8 +1,19 @@
import { next } from "@ember/runloop";
import { htmlSafe } from "@ember/template";
import Component from "@ember/component";
export default Component.extend({
text: null,
init() {
this._super(...arguments);
this.set("text", htmlSafe(this.text));
},
didInsertElement() {
this._super(...arguments);
next(null, () => {
const $this = $(this.element);

View File

@ -4,14 +4,12 @@ import {
autoUpdatingRelativeAge,
number
} from "discourse/lib/formatter";
import { htmlSafe } from "@ember/template";
const safe = Handlebars.SafeString;
registerUnbound("raw-date", dt => htmlSafe(longDate(new Date(dt))));
registerUnbound("raw-date", dt => longDate(new Date(dt)));
registerUnbound(
"age-with-tooltip",
dt => new safe(autoUpdatingRelativeAge(new Date(dt), { title: true }))
registerUnbound("age-with-tooltip", dt =>
htmlSafe(autoUpdatingRelativeAge(new Date(dt), { title: true }))
);
registerUnbound("number", (orig, params) => {
@ -48,5 +46,5 @@ registerUnbound("number", (orig, params) => {
result += ">" + n + "</span>";
return new safe(result);
return htmlSafe(result);
});

View File

@ -1,5 +1,6 @@
import { registerUnbound } from "discourse-common/lib/helpers";
import { isRTL } from "discourse/lib/text-direction";
import { htmlSafe } from "@ember/template";
function setDir(text) {
let content = text ? text : "";
@ -11,5 +12,5 @@ function setDir(text) {
}
export default registerUnbound("dir-span", function(str) {
return new Handlebars.SafeString(setDir(str));
return htmlSafe(setDir(str));
});

View File

@ -1,11 +1,12 @@
import { autoUpdatingRelativeAge, durationTiny } from "discourse/lib/formatter";
import { registerUnbound } from "discourse-common/lib/helpers";
import { htmlSafe } from "@ember/template";
registerUnbound("format-age", function(dt) {
dt = new Date(dt);
return new Handlebars.SafeString(autoUpdatingRelativeAge(dt));
return htmlSafe(autoUpdatingRelativeAge(dt));
});
registerUnbound("format-duration", function(seconds) {
return new Handlebars.SafeString(durationTiny(seconds));
return htmlSafe(durationTiny(seconds));
});

View File

@ -1,5 +1,6 @@
import { computed } from "@ember/object";
import addonFmt from "ember-addons/fmt";
import { htmlSafe as htmlSafeTemplateHelper } from "@ember/template";
/**
Returns whether two properties are equal to each other.
@ -56,6 +57,21 @@ export function i18n(...args) {
return I18n.t(addonFmt(format, ...args.map(a => this.get(a))));
});
}
/**
Returns htmlSafe version of a string.
@method htmlSafe
@params {String} properties* to htmlify
@return {Function} discourseComputedProperty function
**/
export function htmlSafe(...args) {
return computed(...args, {
get() {
const path = args.pop();
return htmlSafeTemplateHelper(this.get(path));
}
});
}
/**
Uses an Ember String `fmt` call to format a string. See:

View File

@ -112,7 +112,7 @@
{{#if contactInfo}}
<section class='about contact'>
<h3>{{d-icon "far-envelope"}} {{i18n 'about.contact'}}</h3>
<p>{{{contactInfo}}}</p>
<p>{{html-safe contactInfo}}</p>
</section>
{{/if}}

View File

@ -1,5 +1,5 @@
<div class='ac-message'>
{{{accountCreated.message}}}
{{html-safe accountCreated.message}}
</div>
{{#if accountCreated.show_controls}}
{{activation-controls sendActivationEmail=(action "sendActivationEmail")

View File

@ -1,6 +1,6 @@
<div class='ac-message'>
{{#if email}}
{{{i18n 'login.sent_activation_email_again' currentEmail=email}}}
{{i18n 'login.sent_activation_email_again' currentEmail=email}}
{{else}}
{{i18n 'login.sent_activation_email_again_generic'}}
{{/if}}

View File

@ -42,7 +42,7 @@
{{#user-info user=ub.user size="medium" class="badge-info" date=ub.granted_at}}
<div class="granted-on">{{i18n 'badges.granted_on' date=(inline-date ub.granted_at)}}</div>
{{#if ub.post_number}}
<a class="post-link" href="{{ub.topic.url}}/{{ub.post_number}}">{{{ub.topic.fancyTitle}}}</a>
<a class="post-link" href="{{ub.topic.url}}/{{ub.post_number}}">{{html-safe ub.topic.fancyTitle}}</a>
{{/if}}
{{/user-info}}
{{/each}}

View File

@ -3,7 +3,7 @@
<div class="user-image">
<div class="user-image-inner">
<a href={{userTemplate.userPath}} data-user-card={{userTemplate.username}}>
{{{userTemplate.avatar}}}
{{html-safe userTemplate.avatar}}
</a>
</div>
</div>

View File

@ -11,7 +11,7 @@
<div class='badge-info'>
<div class='badge-info-item'>
<h3><a href={{url}} class='badge-link'>{{badge.name}}</a></h3>
<div class='badge-summary'>{{{summary}}}</div>
<div class='badge-summary'>{{html-safe summary}}</div>
</div>
</div>
</div>

View File

@ -24,7 +24,7 @@
</div>
<div class='description'>
{{{text-overflow class="overflow" text=c.description_excerpt}}}
{{text-overflow class="overflow" text=c.description_excerpt}}
</div>
{{#if c.isGrandParent}}
{{#each c.subcategories as |subcategory|}}

View File

@ -16,7 +16,7 @@
{{category-title-link category=c}}
{{#if c.description_excerpt}}
<div class="category-description">
{{{dir-span c.description_excerpt}}}
{{dir-span c.description_excerpt}}
</div>
{{/if}}
{{#if c.isGrandParent}}
@ -28,7 +28,7 @@
{{category-title-link tagName="h4" category=subcategory}}
{{#if subcategory.description_excerpt}}
<div class="category-description subcategory-description">
{{{dir-span subcategory.description_excerpt}}}
{{dir-span subcategory.description_excerpt}}
</div>
{{/if}}
{{#if subcategory.subcategories}}
@ -45,7 +45,7 @@
{{else}}
{{#if subcategory.description_excerpt}}
<div class="category-description subcategory-description">
{{{dir-span subcategory.description_excerpt}}}
{{dir-span subcategory.description_excerpt}}
</div>
{{/if}}
{{/if}}
@ -69,7 +69,7 @@
{{/if}}
</td>
<td class="topics">
<div title={{c.statTitle}}>{{{c.stat}}}</div>
<div title={{c.statTitle}}>{{html-safe c.stat}}</div>
{{category-unread category=c tagName="div" class="unread-new"}}
</td>
{{#if showTopics}}

View File

@ -3,7 +3,7 @@
{{/if}}
{{#if translatedLabel}}
<span class='d-button-label'>{{{translatedLabel}}}{{#if ellipsis}}&hellip;{{/if}}</span>
<span class='d-button-label'>{{html-safe translatedLabel}}{{#if ellipsis}}&hellip;{{/if}}</span>
{{/if}}
{{yield}}

View File

@ -46,7 +46,7 @@
</div>
<div class="d-editor-preview-wrapper {{if forcePreview 'force-preview'}}">
<div class="d-editor-preview">{{{preview}}}</div>
<div class="d-editor-preview">{{html-safe preview}}</div>
{{plugin-outlet name="editor-preview" classNames="d-editor-plugin" args=outletArgs}}
</div>
</div>

View File

@ -3,9 +3,9 @@
<div id="banner" class={{overlay}}>
{{d-button icon="times" action="dismiss" class="btn btn-flat close" title="banner.close"}}
<div id="banner-content">
{{{content}}}
{{html-safe content}}
{{#if currentUser.staff}}
<p><a href={{banner.url}}>{{{i18n "banner.edit"}}}</a></p>
<p><a href={{banner.url}}>{{i18n "banner.edit"}}</a></p>
{{/if}}
</div>
</div>

View File

@ -1 +1 @@
{{{translatedText}}}
{{html-safe translatedText}}

View File

@ -1,7 +1,7 @@
{{#if category.isUncategorizedCategory}}
<p class="warning">
{{d-icon "exclamation-triangle"}}
{{{i18n 'category.uncategorized_general_warning' settingLink=uncategorizedSiteSettingLink customizeLink=customizeTextContentLink}}}
{{i18n 'category.uncategorized_general_warning' settingLink=uncategorizedSiteSettingLink customizeLink=customizeTextContentLink}}
</p>
{{/if}}
@ -36,7 +36,7 @@
<section class='field'>
<label>{{i18n 'category.description'}}</label>
{{#if category.description}}
{{{category.description}}}
{{html-safe category.description}}
{{else}}
{{i18n 'category.no_description'}}
{{/if}}
@ -51,7 +51,7 @@
<section class='field'>
<label>{{i18n 'category.badge_colors'}}</label>
<div class="category-color-editor">
{{{categoryBadgePreview}}}
{{html-safe categoryBadgePreview}}
<div class='input-prepend input-append' style="margin-top: 10px;">
<span class='color-title'>{{i18n 'category.background_color'}}:</span>

View File

@ -11,7 +11,7 @@
{{#each category.permissions as |p|}}
<li>
<span class="name"><span class="badge-group">{{p.group_name}}</span></span>
{{{i18n "category.can"}}}
{{i18n "category.can"}}
<span class="permission">{{p.permission.description}}</span>
{{#if editingPermissions}}
<a class="remove-permission" href {{action "removePermission" p}}>{{d-icon "times-circle"}}</a>

View File

@ -1,10 +1,10 @@
{{raw "topic-status" topic=topic}}
<a class='title' href={{topic.lastUnreadUrl}}>{{{topic.fancyTitle}}}</a>
<a class='title' href={{topic.lastUnreadUrl}}>{{html-safe topic.fancyTitle}}</a>
{{topic-post-badges newPosts=topic.totalUnread unseen=topic.unseen url=topic.lastUnreadUrl}}
{{#if latestTopicOnly}}
<div class='last-user-info'>
{{i18n 'categories.latest_by'}} <a href={{{topic.lastPosterUrl}}}>{{topic.last_poster.username}}</a>
{{i18n 'categories.latest_by'}} <a href={{html-safe topic.lastPosterUrl}}>{{topic.last_poster.username}}</a>
<a href={{topic.lastPostUrl}}>{{format-age topic.last_posted_at}}</a>
</div>
{{else}}

View File

@ -5,7 +5,7 @@
<input type='radio' id="radio_{{flag.name_key}}" {{action "changePostActionType" flag}} name='post_action_type_index'>
<div class='flag-action-type-details'>
<span class='description'>{{{flag.description}}}</span>
<span class='description'>{{html-safe flag.description}}</span>
{{#if showMessageInput}}
{{textarea name="message" class="flag-message" placeholder=customPlaceholder value=message}}
<div class="custom-message-length {{customMessageLengthClasses}}">{{customMessageLength}}</div>
@ -24,7 +24,7 @@
<div class='flag-action-type-details'>
<strong>{{formattedName}}</strong>
{{#if showDescription}}
<div class='description'>{{{description}}}</div>
<div class='description'>{{html-safe description}}</div>
{{/if}}
{{#if showMessageInput}}
{{textarea name="message" class="flag-message" placeholder=customPlaceholder value=message}}

View File

@ -1,4 +1,4 @@
{{#if education}}<div class="education">{{{education}}}</div>{{/if}}
{{#if education}}<div class="education">{{html-safe education}}</div>{{/if}}
<h3>
{{message}}
{{yield}}

View File

@ -2,9 +2,9 @@
<div class="row">
<div id="global-notice-{{notice.id}}" class="alert alert-{{notice.options.level}} {{notice.id}}">
{{#if notice.options.html}}
{{{notice.options.html}}}
{{html-safe notice.options.html}}
{{/if}}
<span class="text">{{{notice.text}}}</span>
<span class="text">{{html-safe notice.text}}</span>
{{#if notice.options.dismissable}}
{{d-button

View File

@ -43,7 +43,7 @@
{{#if group.bio_cooked}}
<div class="card-row second-row">
<div class='bio'>{{{group.bio_cooked}}}</div>
<div class='bio'>{{html-safe group.bio_cooked}}</div>
</div>
{{/if}}

View File

@ -8,7 +8,7 @@
<div class='stream-topic-details'>
<div class='stream-topic-title'>
<span class='title'>
<a href={{postUrl}}>{{{post.topic.fancyTitle}}}</a>
<a href={{postUrl}}>{{html-safe post.topic.fancyTitle}}</a>
</span>
</div>
<div class="group-post-category">{{category-link post.category}}</div>
@ -24,8 +24,8 @@
<div class='excerpt'>
{{#if post.expandedExcerpt}}
{{{post.expandedExcerpt}}}
{{html-safe post.expandedExcerpt}}
{{else}}
{{{post.excerpt}}}
{{html-safe post.excerpt}}
{{/if}}
</div>

View File

@ -1,6 +1,6 @@
{{#if inviteModel.error}}
<div class="alert alert-error">
{{{errorMessage}}}
{{html-safe errorMessage}}
</div>
{{/if}}
@ -10,7 +10,7 @@
{{generated-invite-link link=inviteModel.inviteLink email=emailOrUsername}}
{{else}}
<div class="success-message">
{{{successMessage}}}
{{html-safe successMessage}}
</div>
{{/if}}
{{else}}

View File

@ -14,7 +14,7 @@
{{d-button action=(action "copy") class="pull-right no-text" icon="copy"}}
{{/if}}
<h4>{{i18n "ip_lookup.title"}}</h4>
<p class='powered-by'>{{{i18n "ip_lookup.powered_by"}}}</p>
<p class='powered-by'>{{i18n "ip_lookup.powered_by"}}</p>
<dl>
{{#if location}}
{{#if location.hostname}}

View File

@ -5,7 +5,7 @@
{{#if topic.unseen}}
<span class="badge-notification new-topic"></span>
{{/if}}
<span class={{cold-age-class topic.last_posted_at}} title={{raw-date topic.last_posted_at}}>{{{format-age topic.last_posted_at}}}</span>
<span class={{cold-age-class topic.last_posted_at}} title={{raw-date topic.last_posted_at}}>{{format-age topic.last_posted_at}}</span>
</div>
</td>
<td class='num posts'>{{raw "list/post-count-or-badges" topic=topic postBadgesEnabled="true"}}</td>

View File

@ -10,5 +10,5 @@
</div>
{{#if targetUser}}
<h3 class="see-all-pms-message">{{{i18n "related_messages.see_all" path=searchLink username=targetUser.username}}}</h3>
<h3 class="see-all-pms-message">{{i18n "related_messages.see_all" path=searchLink username=targetUser.username}}</h3>
{{/if}}

View File

@ -3,6 +3,6 @@
{{#if showUsername}}
{{#link-to 'user' post.user class="username"}}@{{post.user.username}}{{/link-to}}
{{/if}}
{{{post.excerpt}}}
{{html-safe post.excerpt}}
</div>
{{/if}}

View File

@ -17,7 +17,7 @@
{{#if reviewable.blank_post}}
<p>{{i18n "review.deleted_post"}}</p>
{{else}}
{{{reviewable.cooked}}}
{{html-safe reviewable.cooked}}
{{/if}}
</div>
{{plugin-outlet name="after-reviewable-flagged-post-body" args=(hash model=reviewable)}}

View File

@ -46,7 +46,7 @@
<div class='reviewable-actions'>
{{#if claimEnabled}}
<div class='claimed-actions'>
<span class='help'>{{{claimHelp}}}</span>
<span class='help'>{{html-safe claimHelp}}</span>
{{reviewable-claimed-topic topicId=topicId claimedBy=reviewable.claimed_by}}
</div>
{{/if}}

View File

@ -49,7 +49,7 @@
{{#if rs.reason}}
<tr>
<td colspan='7'>
<div class='reviewable-score-reason'>{{{rs.reason}}}</div>
<div class='reviewable-score-reason'>{{html-safe rs.reason}}</div>
</td>
</tr>
{{/if}}

View File

@ -1,7 +1,7 @@
<div id="second-factor">
<h3>{{secondFactorTitle}}</h3>
{{#if optionalText}}
<p>{{{optionalText}}}</p>
<p>{{html-safe optionalText}}</p>
{{/if}}
<p>{{secondFactorDescription}}</p>
{{yield}}

View File

@ -1,5 +1,5 @@
<div class="header">
<h3 class="title">{{{shareTitle}}}</h3>
<h3 class="title">{{html-safe shareTitle}}</h3>
</div>
<div class="body">

View File

@ -1,5 +1,5 @@
<div class="title">
<h3>{{{shareTitle}}}</h3>
<h3>{{html-safe shareTitle}}</h3>
{{#if date}}
<span class="date">{{displayDate}}</span>

View File

@ -2,6 +2,6 @@
{{#if source.icon}}
{{d-icon source.icon}}
{{else}}
{{{source.htmlIcon}}}
{{html-safe source.htmlIcon}}
{{/if}}
</a>

View File

@ -2,7 +2,7 @@
{{#if publishing}}
{{i18n "shared_drafts.publishing"}}
{{else}}
{{{i18n "shared_drafts.notice" category=topic.category.name}}}
{{i18n "shared_drafts.notice" category=topic.category.name}}
<div class='publish-field'>
<label>{{i18n "shared_drafts.destination_category"}}</label>

View File

@ -13,4 +13,4 @@
{{/if}}
</div>
<h3 class="suggested-topics-message">{{{browseMoreMessage}}}</h3>
<h3 class="suggested-topics-message">{{html-safe browseMoreMessage}}</h3>

View File

@ -32,7 +32,7 @@
{{#if tagInfo.synonyms}}
<div class="synonyms-list">
<h3>{{i18n "tagging.synonyms"}}</h3>
<div>{{{i18n "tagging.synonyms_description" base_tag_name=tagInfo.name}}}</div>
<div>{{i18n "tagging.synonyms_description" base_tag_name=tagInfo.name}}</div>
<div class="tag-list">
{{#each tagInfo.synonyms as |tag|}}
<div class='tag-box'>

View File

@ -1 +1 @@
{{{text}}}
{{html-safe text}}

View File

@ -1,7 +1,7 @@
{{#d-button action=(action "enterTop") class="full jump-top"}}
{{d-icon 'step-backward'}} {{{topDate}}}
{{d-icon 'step-backward'}} {{html-safe topDate}}
{{/d-button}}
{{#d-button action=(action "enterBottom") class="full jump-bottom"}}
{{{bottomDate}}} {{d-icon 'step-forward'}}
{{html-safe bottomDate}} {{d-icon 'step-forward'}}
{{/d-button}}

View File

@ -144,7 +144,7 @@
<div class="card-row">
<div class="featured-topic">
<span class="desc">{{i18n 'user.featured_topic'}}</span>
{{#link-to "topic" user.featured_topic.slug user.featured_topic.id }}{{{user.featured_topic.fancy_title}}}{{/link-to}}
{{#link-to "topic" user.featured_topic.slug user.featured_topic.id }}{{html-safe user.featured_topic.fancy_title}}{{/link-to}}
</div>
</div>
{{/if}}

View File

@ -1,6 +1,6 @@
{{#if field.name}}
<label class="control-label" for={{concat 'user-' elementId}}>
{{{field.name}}} {{#if field.required}}<span class='required'>*</span>{{/if}}
{{html-safe field.name}} {{#if field.required}}<span class='required'>*</span>{{/if}}
</label>
{{/if}}
@ -8,7 +8,7 @@
<label class="control-label checkbox-label">
{{input id=(concat 'user-' elementId) checked=value type="checkbox"}}
<span>
{{{field.description}}} {{#unless field.name}}{{#if field.required}}<span class='required'>*</span>{{/if}}{{/unless}}
{{html-safe field.description}} {{#unless field.name}}{{#if field.required}}<span class='required'>*</span>{{/if}}{{/unless}}
</span>
</label>
</div>

View File

@ -1,4 +1,4 @@
<label class="control-label" for={{concat 'user-' elementId}}>{{{field.name}}} {{#if field.required}}<span class='required'>*</span>{{/if}}
<label class="control-label" for={{concat 'user-' elementId}}>{{html-safe field.name}} {{#if field.required}}<span class='required'>*</span>{{/if}}
</label>
<div class='controls'>
{{combo-box
@ -10,5 +10,5 @@
none=noneLabel
onChange=(action (mut value))
}}
<div class="instructions">{{{field.description}}}</div>
<div class="instructions">{{html-safe field.description}}</div>
</div>

View File

@ -1,6 +1,6 @@
<label class="control-label" for={{concat 'user-' elementId}}>{{{field.name}}} {{#if field.required}}<span class='required'>*</span>{{/if}}
<label class="control-label" for={{concat 'user-' elementId}}>{{html-safe field.name}} {{#if field.required}}<span class='required'>*</span>{{/if}}
</label>
<div class='controls'>
{{input id=(concat 'user-' elementId) value=value maxlength=site.user_field_max_length}}
<div class="instructions">{{{field.description}}}</div>
<div class="instructions">{{html-safe field.description}}</div>
</div>

View File

@ -9,5 +9,5 @@
</span>
<span class='label'>
{{#if icon}}{{d-icon icon}}{{/if}}
{{{i18n label count=value}}}
{{i18n label count=value}}
</span>

View File

@ -2,7 +2,7 @@
<a href={{item.userUrl}} data-user-card={{item.username}} class='avatar-link'><div class='avatar-wrapper'>{{avatar item imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
<span class='time'>{{format-date item.created_at}}</span>
{{#if item.draftType}}
<span class='draft-type'>{{{item.draftType}}}</span>
<span class='draft-type'>{{html-safe item.draftType}}</span>
{{else}}
{{expand-post item=item}}
{{/if}}
@ -11,9 +11,9 @@
{{topic-status topic=item disableActions=true}}
<span class="title">
{{#if item.postUrl}}
<a href={{item.postUrl}}>{{{item.title}}}</a>
<a href={{item.postUrl}}>{{html-safe item.title}}</a>
{{else}}
{{{item.title}}}
{{html-safe item.title}}
{{/if}}
</span>
</div>
@ -36,11 +36,13 @@
{{/if}}
<p class='excerpt' data-topic-id={{item.topic_id}} data-post-id={{item.post_id}} data-user-id={{item.user_id}}>
{{!-- template-lint-disable no-triple-curlies --}}
{{~#if item.expandedExcerpt}}
{{~{item.expandedExcerpt}~}}
{{else}}
{{~{item.excerpt}~}}
{{/if~}}
{{!-- template-lint-enable --}}
</p>
{{#each item.children as |child|}}

View File

@ -6,4 +6,4 @@
{{/if}}
</span>
<br>
<a href={{url}}>{{{topic.fancyTitle}}}</a>
<a href={{url}}>{{html-safe topic.fancyTitle}}</a>

View File

@ -204,7 +204,7 @@
{{d-button action=(action "togglePreview") class="hide-preview" label="composer.hide_preview"}}
{{/if}}
{{else}}
<a href {{action "togglePreview"}} class='toggle-preview'>{{{toggleText}}}</a>
<a href {{action "togglePreview"}} class='toggle-preview'>{{html-safe toggleText}}</a>
{{/if}}
</div>
@ -221,7 +221,7 @@
<div class='draft-text'>
{{#if model.topic}}
{{d-icon "share"}} {{{draftTitle}}}
{{d-icon "share"}} {{html-safe draftTitle}}
{{else}}
{{i18n "composer.saved_draft"}}
{{/if}}

View File

@ -1,3 +1,3 @@
<a href {{action "closeMessage"}} class='close'>{{d-icon "times"}}</a>
{{#if message.title}}<h3>{{message.title}}</h3>{{/if}}
<p>{{{message.body}}}</p>
<p>{{html-safe message.body}}</p>

View File

@ -1,2 +1,2 @@
<a href {{action "closeMessage"}} class='close'>{{d-icon "times"}}</a>
{{{message.body}}}
{{html-safe message.body}}

View File

@ -1,2 +1,2 @@
<a href {{action "closeMessage"}} class='close'>{{d-icon "times"}}</a>
{{{message.body}}}
{{html-safe message.body}}

View File

@ -1,5 +1,5 @@
{{#if errorHtml}}
{{{errorHtml}}}
{{html-safe errorHtml}}
{{else}}
<div class="container">
{{discourse-banner user=currentUser banner=site.banner}}

View File

@ -49,7 +49,7 @@
<div class='search-info'>
<div class='result-count'>
{{{resultCountLabel}}}
{{html-safe resultCountLabel}}
</div>
<div class='sort-by'>
<span class='desc'>
@ -88,7 +88,7 @@
<a class='search-link' href={{result.url}} {{action "logClick" result.topic_id}}>
{{topic-status topic=result.topic disableActions=true showPrivateMessageIcon=true}}
<span class='topic-title'>{{#highlight-text highlight=q}}{{{result.topic.fancyTitle}}}{{/highlight-text}}</span>
<span class='topic-title'>{{#highlight-text highlight=q}}{{html-safe result.topic.fancyTitle}}{{/highlight-text}}</span>
</a>
<div class='search-category'>
@ -113,7 +113,7 @@
{{#if result.blurb}}
{{#highlight-text highlight=highlightQuery}}
{{{result.blurb}}}
{{html-safe result.blurb}}
{{/highlight-text}}
{{/if}}
</div>

Some files were not shown because too many files have changed in this diff Show More