6

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.

roryf
  • 29,592
  • 16
  • 81
  • 103

2 Answers2

4

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.

tylerl
  • 30,197
  • 13
  • 80
  • 113
1

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 (<!-- -->).

flq
  • 22,247
  • 8
  • 55
  • 77