Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/helpers/html-safe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { helper } from '@ember/component/helper';
import { htmlSafe as markAsSafe } from '@ember/template';

export function htmlSafe([content] /*, hash*/) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use array destructuring on all browsers we support? Or do we compile the JS files somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config/targets.js tells ember-cli-babel which browsers we support so it knows which features to compile, and I think our listed browsers support array destructuring. I'd have to check UCAndroid.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the JS files are compiled with Babel, that's all I need to know. I don't know our frontend infrastructure too well.

return markAsSafe(content);
}

export default helper(htmlSafe);
2 changes: 1 addition & 1 deletion app/templates/components/crate-readme.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{{rendered}}}
{{html-safe rendered}}
6 changes: 5 additions & 1 deletion app/templates/crate/owners.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
{{/link-to}}
</div>
<div class='stats'>
{{{ if user.email user.email "&nbsp;" }}}
{{#if user.email}}
{{user.email}}
{{else}}
&nbsp;
{{/if}}
</div>
<div class='stats downloads'>
<button class='remove-owner small yellow-button' {{action 'removeOwner' user}}>Remove</button>
Expand Down