【发布时间】:2014-10-19 06:17:27
【问题描述】:
如果可能,我只想更改 ejs 文件,如下所示:
...
<?= comment.description -?>
...
comment.description 包含这样的内容:
foo
Lorem ipsum dolor sit amet
是否可以使用comment.description在模板之前内执行JavaScript代码?
我只想删除comment.description的第一行:
comment.description = comment.description.split("\n").slice(1).join("\n");
【问题讨论】:
标签: javascript templates ejs