HTML comments in Spark view engine
Asked Answered
A

2

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.

Admonitory answered 14/4, 2010 at 10:43 Comment(3)
What if you used: #//comment?Vantage
That would do but I was hoping for a more 'HTML-ly' like way of doing it, especially for commenting out large blocks.Admonitory
#/* comment ... more lines ... # */ ?Manizales
H
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.

Harsh answered 13/5, 2010 at 8:11 Comment(0)
F
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 (<!-- -->).

Fagaly answered 14/4, 2010 at 11:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.