Nathan Bubna wrote:
Christoph Reck said:

having a completely whitespace-gobbling-free handling is a clean as
you can get; but it is not what most people expect.


hard to say, i've taken no polls.  personally, i expect WYTIWYG from a
template language.  :)  but still...

I expect that when adding velocity markup to an existing text file to not affect the spacing in the output. This includes indented #foreach directives and inner indented #if/#set/#macro directives. I have seen others on the list also complaining about the extra whitespaces emitted in such cases.

So the rule I proposed was to allow adding velocity markup, one per line,
and still have the same output - e.g. add an #if statement around
existing text to conditionally mask it out. Or add an #foreach around
a table row and be able to repeat the body with dynamic data, etc.



So it might
be good to cleanup the parser to not gobble anything, but have some
pluggable AST-post-processors to do the desired trimming - in
addition to the filter directive.


yes, i would hope that there is a way to "filter" or otherwise process
templates en masse automatically.  i think most people wanting this would want
the same "filtering" done on all of their templates in a single app.  they
shouldn't have to enclose all their templates in #filter( foo) ... #end.

it would be ideal to have filters or post-processors that could be specified
either globally in velocity.properties or employed inline via a #filter
directive.  i don't know how best these would be implemented though.

Please note that I'm differentiating between reformatting the AST at parse time (e.g. gobbling nodes with whitespaces...) and filtering the output after a merge.


Nathan Bubna [EMAIL PROTECTED]

-- :) Christoph Reck


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to