Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML comments in Spark view engine

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.

like image 947
roryf Avatar asked Apr 14 '10 10:04

roryf


2 Answers

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.

like image 191
tylerl Avatar answered Sep 22 '22 22:09

tylerl


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

like image 34
flq Avatar answered Sep 18 '22 22:09

flq