Skip to content

A platform for community discussion. Free, open, simple.

DEV: Only mark translations as htmlSafe for DButton (#30958)

David Taylor2b63830496f2
diff --git a/app/assets/javascripts/discourse/app/components/d-button.gjs b/app/assets/javascripts/discourse/app/components/d-button.gjs
index e89b7d028d8..a3861139257 100644
--- a/app/assets/javascripts/discourse/app/components/d-button.gjs
+++ b/app/assets/javascripts/discourse/app/components/d-button.gjs
@@ -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~}}
&hellip;
{{~/if~}}