mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
templates: Enable Handlebars strict mode.
https://handlebarsjs.com/api-reference/compilation.html Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
2f203f4de1
commit
b533cd979e
@@ -24,7 +24,7 @@ hb.JavaScriptCompiler = ZJavaScriptCompiler;
|
|||||||
|
|
||||||
function compile_hbs(module, filename) {
|
function compile_hbs(module, filename) {
|
||||||
const code = fs.readFileSync(filename, "utf8");
|
const code = fs.readFileSync(filename, "utf8");
|
||||||
const pc = hb.precompile(code, {preventIndent: true, srcName: filename});
|
const pc = hb.precompile(code, {preventIndent: true, srcName: filename, strict: true});
|
||||||
const node = new SourceNode();
|
const node = new SourceNode();
|
||||||
node.add([
|
node.add([
|
||||||
'const Handlebars = require("handlebars/runtime");\n',
|
'const Handlebars = require("handlebars/runtime");\n',
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ export default (
|
|||||||
"rendered_markdown",
|
"rendered_markdown",
|
||||||
"tooltip_hotkey_hints",
|
"tooltip_hotkey_hints",
|
||||||
],
|
],
|
||||||
|
precompileOptions: {strict: true},
|
||||||
preventIndent: true,
|
preventIndent: true,
|
||||||
// This replaces relative image resources with
|
// This replaces relative image resources with
|
||||||
// a computed require() path to them, so their
|
// a computed require() path to them, so their
|
||||||
|
|||||||
Reference in New Issue
Block a user