是否有 Handlebars 保留字的官方列表?

Is there an official list for Handlebars reserved words?

在努力使用名为 {{engine.x.y}} 的模板变量后,"silently" 什么也没显示,直到我将其更改为其他内容(例如 {{_engine.x.y}}),我才看到 other words such as {{action}} seemed to be "reserved", with no "escaping" possibility ...

是否有这样的 "reserved words" 列表以减少 "surprise factor" ?我找不到。

编辑

找到了 - 问题不在于 Handlebars(Josh Crozier 发现它在上面的评论中没有保留任何名称),而是在于您正在使用的 email-templates 库。 render 它使用的函数在作为模板上下文传递的对象上设置了几个属性,这意味着如果您的对象包含具有相同名称的属性,它们会被破坏。

email-templates源代码中的相关代码行可以找到here,但为了完整起见,被覆盖的属性是:

  • filename(设置为模板的文件名)
  • engine(设置为正在使用的模板引擎的文件扩展名)
  • templatePath(设置为包含您的模板的目录)

最明显的解决方案是只更改名称,但如果这不是一个选项,您可能需要 file an issue on their repo