Beginning views with '#'

0 views
Skip to first unread message

Nick

unread,
Dec 16, 2008, 3:35:13 PM12/16/08
to Spark View Engine Dev
Seems that starting a spark view with a '#' style statement causes the
spark compiler to write "Output.Write("# my statements")" rather than
the expected behavior. For example, many of my views do something like
this:

# using (this.FormFor("action"))
<tags/>
# }

Where this.FormFor writes a <form> and then returns an IDisposable
that writes a closing form tag when it's Dispose()'ed, similar to the
asp.net mvc forms helpers.

If I add an initial tag to the top of the file, all works fine, and
the trailing "# }" always works correctly, leading to some very
interesting view compilation errors :)

Louis DeJardin

unread,
Dec 16, 2008, 3:53:35 PM12/16/08
to spar...@googlegroups.com
Ah! You're right that is a problem. Because the # must be the first non-whitespace character on a line it's looking for a newline, any amount of optional whitespace, and the #.

Starting with a single blank line would be a workaround for now.
Reply all
Reply to author
Forward
0 new messages