mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
templates: Add {{#let}} block helper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
e83538167f
commit
f81cc16a0f
@@ -28,6 +28,21 @@ run_test("or", () => {
|
||||
assert.equal(html, "\n<p>last or</p>\n<p>true or</p>\n");
|
||||
});
|
||||
|
||||
run_test("let", () => {
|
||||
const html = require("./templates/let.hbs")({
|
||||
outer_var: "hello",
|
||||
});
|
||||
assert.equal(
|
||||
html,
|
||||
`\
|
||||
outer_var = hello
|
||||
keyword_var = <b>escaped</b>
|
||||
block_var = <b>unescaped</b> with hello
|
||||
|
||||
`,
|
||||
);
|
||||
});
|
||||
|
||||
run_test("rendered_markdown", () => {
|
||||
const html = require("./templates/rendered_markdown.hbs")();
|
||||
const expected_html =
|
||||
|
||||
Reference in New Issue
Block a user