Spark 视图引擎中的 HTML 注释

发布于 2024-08-29 00:47:14 字数 246 浏览 1 评论 0原文

如何注释掉 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弥繁 2024-09-05 00:47:14

我使用

# /* 
   Comment
   Goes
   Here
# */

(EDIT) 更好的是,只需使用 ASPX 样式标签:

<title> Hello World <% /* comment 
        goes here */ %> </title>

当然,如果您不介意在源代码中看到注释文本,那么 HTML 注释也始终有效。

I use

# /* 
   Comment
   Goes
   Here
# */

(EDIT) Better yet, just use ASPX style tags:

<title> Hello World <% /* comment 
        goes here */ %> </title>

And, of course, HTML comments always work, too, if you don't mind seeing the commented text in your source.

狂之美人 2024-09-05 00:47:14

有点搞笑,我也没找到。
我在解析区域查看了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 (<!-- -->).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文