From 370e6765f896095f6ac8d48c0fcbc955dfb76d1e Mon Sep 17 00:00:00 2001 From: apoorvapendse Date: Wed, 30 Jul 2025 14:09:52 +0530 Subject: [PATCH] dialog_widget: Use `_html` variables in template. This is done to ensure that variables in HTML string format which should not be escaped in templates, have a consistent _html suffix. The commits that follow do the same style of refactors in other areas. Discussion: https://chat.zulip.org/#narrow/channel/6-frontend/topic/Add.20linter.20rule.20to.20denote.20HTML.20string.20in.20template/near/2232128 Signed-off-by: apoorvapendse --- web/src/dialog_widget.ts | 12 ++++++------ web/templates/dialog_widget.hbs | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.ts index cc388a0f5f..ee54332987 100644 --- a/web/src/dialog_widget.ts +++ b/web/src/dialog_widget.ts @@ -194,16 +194,16 @@ export function launch(conf: DialogWidgetConfig): string { widget_id_counter += 1; const modal_unique_id = current_dialog_widget_id(); - const html_submit_button = conf.html_submit_button ?? $t_html({defaultMessage: "Save changes"}); - const html_exit_button = conf.html_exit_button ?? $t_html({defaultMessage: "Cancel"}); + const submit_button_html = conf.html_submit_button ?? $t_html({defaultMessage: "Save changes"}); + const exit_button_html = conf.html_exit_button ?? $t_html({defaultMessage: "Cancel"}); const html = render_dialog_widget({ modal_unique_id, - html_heading: conf.html_heading, + heading_html: conf.html_heading, text_heading: conf.text_heading, link: conf.help_link, - html_submit_button, - html_exit_button, - html_body: conf.html_body, + submit_button_html, + exit_button_html, + body_html: conf.html_body, id: conf.id, single_footer_button: conf.single_footer_button, always_visible_scrollbar: conf.always_visible_scrollbar, diff --git a/web/templates/dialog_widget.hbs b/web/templates/dialog_widget.hbs index c4f8c178ae..6d5c4041f8 100644 --- a/web/templates/dialog_widget.hbs +++ b/web/templates/dialog_widget.hbs @@ -3,8 +3,8 @@
- {{{ html_body }}} + {{{ body_html }}}