mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Only mark translations as htmlSafe for DButton (#30958)
If a consumer is passing in their own string to `@translatedLabel`, then they should set it as `htmlSafe` themselves (if it is indeed safe)
This commit is contained in:
parent
097d987332
commit
2b63830496
@ -59,7 +59,7 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {
|
||||
|
||||
get computedLabel() {
|
||||
if (this.args.label) {
|
||||
return i18n(this.args.label);
|
||||
return htmlSafe(i18n(this.args.label));
|
||||
}
|
||||
return this.args.translatedLabel;
|
||||
}
|
||||
@ -225,7 +225,7 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {
|
||||
|
||||
{{~#if this.computedLabel~}}
|
||||
<span class="d-button-label">
|
||||
{{~htmlSafe this.computedLabel~}}
|
||||
{{~this.computedLabel~}}
|
||||
{{~#if @ellipsis~}}
|
||||
…
|
||||
{{~/if~}}
|
||||
|
Loading…
Reference in New Issue
Block a user