发布于 2014-05-15 09:40:31
实际上,<% %>中的所有内容都是coffeescript (ECO = Embedded CoffeeScript)。CoffeeScript中的注释使用#字符来注释一行( ###用于多行注释)。请参阅/“不管用
所以在ECO中,你会这样评论:
<% #This is a single line comment %>如果您检查ECO模板的源代码,就可以看到在scanner.js中处理注释情况的正则表达式。
Scanner.modePatterns = {
data: /(.*?)(<%%|<%\s*(\#)|<%(([=-])?)|\n|$)/,
code: /(.*?)((((:|(->|=>))\s*))?%>|\n|$)/,
comment: /(.*?)(%>|\n|$)/
};发布于 2017-07-05 08:22:26
有一个特殊的注释标记,即<%# %>
示例:
<%# This is a single line comment %>https://stackoverflow.com/questions/22082656
复制相似问题