Spark 视图引擎中的 HTML 注释
如何注释掉 Spark 视图的某些部分,以便它们不会呈现给客户端?
在 aspx 页面中,我可以这样做:
<%-- server-side comment --%>
我原以为使用三个破折号会起作用:
<!--- server-side comment --->
但它不起作用,我现在找不到我读到的资源。
How can I comment out parts of a Spark view so they aren't rendered to the client?
In aspx pages I can do this:
<%-- server-side comment --%>
I had thought using three dashes would work:
<!--- server-side comment --->
but it doesn't work and I now can't find the resource where I read that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用
(EDIT) 更好的是,只需使用 ASPX 样式标签:
当然,如果您不介意在源代码中看到注释文本,那么 HTML 注释也始终有效。
I use
(EDIT) Better yet, just use ASPX style tags:
And, of course, HTML comments always work, too, if you don't mind seeing the commented text in your source.
有点搞笑,我也没找到。
我在解析区域查看了spark的源代码。我找到了 代码语法解析我认为这适用于代码块。在那里你应该能够使用//。然后在标记语法中,唯一提到的注释是标准 HTML 注释 (
)。
It's kinda funny, I couldn't find either.
I looked into the source code of spark, in the parsing area. I found the code grammar parse which is I assume applicable to code blocks. In there you should be able to use //. Then in the markup grammar, the only mention of commenting is the standard HTML commenting (
<!-- -->
).