From: Marc P. <ma...@an...> - 2003-08-01 18:15:02
|
On Fri, 1 Aug 2003 13:40:58 -0400 (GMT), Keats <ke...@su...> wrote: > Stripping the previous newline is definitely a major point of confusion, > but it makes sense once you grok it. Making more special cases would, > IMHO, not only make the parser more complicated, but also make it harder > to learn and remember the rules. > > To make your example work you just need to add a blank line: > > [ > > #if ($someCondition) > #begin > #if ($someOtherCondition) > #begin > This is a line > This is another line > #end > #end > ] Yes I know that... > Yes it's confusing, but once you understand it it works fine and it is > consistent. ...but it is not consistent with $xxx expansion: [ $somethingHere ] Would produce a superfluous blank line. I know WE know var expansion and directives are completely different, but to the average user why should whitespace handling be any different. > If you want a bunch of stuff without newlines you can write: [snip] > > to get > > [10, (20), 50, (100)] > > Writing this all on one line would really suck. Perhaps... > (Note: I haven't tested this example, but it's something like that.) This is exactly my point though! It should be obvious from the template what the output should be. It definitely isn't, unless you are ready to meticulously apply the WS rules. At least if #xxx expands exactly where the "#" is, and you write it on one line, you know you will get ONE line. :) -- Marc Palmer Contract Java Consultant/Developer w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org |