mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
rendered_markdown: Convert spoiler message to FormatJS.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
00fb1aaadc
commit
00db22ee76
@@ -273,5 +273,5 @@ run_test("spoiler-header-empty-fill", () => {
|
|||||||
'<span class="spoiler-button" aria-expanded="false"><span class="spoiler-arrow"></span></span>';
|
'<span class="spoiler-button" aria-expanded="false"><span class="spoiler-arrow"></span></span>';
|
||||||
$header.html("");
|
$header.html("");
|
||||||
rm.update_elements($content);
|
rm.update_elements($content);
|
||||||
assert.equal(toggle_button_html + "<p>translated: Spoiler</p>", $header.html());
|
assert.equal(toggle_button_html + "<p>translated HTML: Spoiler</p>", $header.html());
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import render_markdown_timestamp from "../templates/markdown_timestamp.hbs";
|
|||||||
import view_code_in_playground from "../templates/view_code_in_playground.hbs";
|
import view_code_in_playground from "../templates/view_code_in_playground.hbs";
|
||||||
|
|
||||||
import * as blueslip from "./blueslip";
|
import * as blueslip from "./blueslip";
|
||||||
import {i18n} from "./i18n";
|
import {$t_html, i18n} from "./i18n";
|
||||||
import {page_params} from "./page_params";
|
import {page_params} from "./page_params";
|
||||||
import * as people from "./people";
|
import * as people from "./people";
|
||||||
import * as rtl from "./rtl";
|
import * as rtl from "./rtl";
|
||||||
@@ -187,7 +187,7 @@ export const update_elements = (content) => {
|
|||||||
// If a spoiler block has no header content, it should have a default header.
|
// If a spoiler block has no header content, it should have a default header.
|
||||||
// We do this client side to allow for i18n by the client.
|
// We do this client side to allow for i18n by the client.
|
||||||
if ($(this).html().trim().length === 0) {
|
if ($(this).html().trim().length === 0) {
|
||||||
$(this).append(`<p>${i18n.t("Spoiler")}</p>`);
|
$(this).append(`<p>${$t_html({defaultMessage: "Spoiler"})}</p>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the expand/collapse button to spoiler blocks
|
// Add the expand/collapse button to spoiler blocks
|
||||||
|
|||||||
Reference in New Issue
Block a user