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

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-10 16:46:57 +01:00
committed by GitHub
parent aec26ad2f0
commit d436b600fb
152 changed files with 345 additions and 284 deletions

View File

@@ -1,10 +1,10 @@
<aside class='quote' data-post="{{post_number}}" data-topic="{{topic_id}}">
<div class='title'>
<div class='quote-controls'></div>
{{{avatar}}}
<a href="{{original_url}}">{{{title}}}</a> {{{category_html}}}
{{html-safe avatar}}
<a href="{{original_url}}">{{html-safe title}}</a> {{html-safe category_html}}
</div>
<blockquote>
{{{quote}}}
{{html-safe quote}}
</blockquote>
</aside>

View File

@@ -1,7 +1,7 @@
<aside class="onebox">
<article class="onebox-body user-onebox">
{{{avatar}}}
<h3><a href="{{original_url}}">{{{username}}}</a></h3>
{{html-safe avatar}}
<h3><a href="{{original_url}}">{{html-safe username}}</a></h3>
<div>
{{#name}}
<span class="full-name">{{name}}</span>
@@ -11,7 +11,7 @@
<svg class="fa d-icon d-icon-map-marker-alt svg-icon" xmlns="http://www.w3.org/2000/svg">
<use xlink:href="#map-marker-alt"></use>
</svg>
{{{location}}}
{{html-safe location}}
</span>
{{/location}}
{{#website}}
@@ -19,12 +19,12 @@
<svg class="fa d-icon d-icon-globe-americas svg-icon" xmlns="http://www.w3.org/2000/svg">
<use xlink:href="#globe-americas"></use>
</svg>
<a href="{{website}}">{{{website_name}}}</a>
<a href="{{website}}">{{html-safe website_name}}</a>
</span>
{{/website}}
</div>
{{#bio}}
<p>{{{bio}}}</p>
<p>{{html-safe bio}}</p>
{{/bio}}
<span>{{joined}} {{created_at}}</span>
</article>