in HAML, we can write ments using
-# some ment and it won't bee HTML and made public
but if it is inside
:javascript
-# ments like this line will break the javascript interpreter as it bees javascript code
// so we are forced to use ment like this and is publicly viewable
is there a way to make it non-public?
in HAML, we can write ments using
-# some ment and it won't bee HTML and made public
but if it is inside
:javascript
-# ments like this line will break the javascript interpreter as it bees javascript code
// so we are forced to use ment like this and is publicly viewable
is there a way to make it non-public?
Share Improve this question edited Feb 20, 2013 at 10:51 nonopolarity asked Jun 3, 2010 at 22:22 nonopolaritynonopolarity 151k142 gold badges489 silver badges781 bronze badges2 Answers
Reset to default 12#{}
- blocks are evaluated, so you can write
#{ # this is a ruby ment, but still a ment (newline is required)
}
Short answer: no.
Long answer: filters in Haml aren't processed by Haml at all, they're simply sent off to the relevant filter processor. For :javascript
, this is a simple processor that just wraps up the text in script tags. There's no support for anything fancy like removing ments. If you want something like that, I'd suggest adding a custom filter that uses some sort of Javascript minifier.