Peter Romianowski wrote:
[snip]velocity.properties ------------------- filter.whitespace = o.a.v.filter.WhitespaceFilter
VTL --- #filter (whitespace) Hi this is something. #end
Output ------ Hi this is something.
Or for christoph
Hithisissomething
:)
Sorry, but this does not follow my proposal:
If a line is looks like this: DirectiveLine ::= LineEnd TabsAndSpaces? Directive TabsAndSpaces? LineEnd TabsAndSpaces ::= (#x20 | #x09)+ LineEnd ::= StartOfStream | ((#x0D #x0A) | #x0D | #x0A) | EndOfStream then the first "TabsAndSpaces?" and the closing "TabsAndSpaces? LineEnd" should be gobbled. (Note that it supports multiline directives, that is why "DirectiveLine" is not simply "Line".) If you whant the first "LineEnd" to be gobbled prepend a ## before it (it is part of the previous line!).
Geir, Your joke does not even follow the HTML/XML-Normalize whitespace handling rules. :-I
Ah, that could be fixed by writing a "dictionary based fuzzy logic word extractor"-Filter, which would be applied as this:
#filter (really_sophisticated_logic_inside) #filter (whitespace) Hi this is something. #end #end
This will result in: "Hi this is so me thing" - in the beta-version ;)
Cool!
I like the idea of the configurable filter directive. Only impact is the additional post-parsing to achieve the desired output with the resulting performance impact. But anyhow it is flexible and powerfull and e.g. together with JTidy would do what many users are asking for.
The alternative is to enhance the velocity parser and handling to support the *proper* handling. And with "proper" I mean that adding (indented/structured) VTL lines should not affect the layout of the page being marked up. See the proposal above.
That would it make easy to have full whitespace suppression. Other filters are possible (HTML-escaping & => &) IMO having such filter-mechanism and a good set of default implementations (WS, HTML-Escaping, WS+NewLine+Tab...-Fitler ...) would make
Velocity much
more powerful.
I like that.
Once 1.3.2 is out, I could make a proposal. It is quite easy design though. But really powerful I think.
+1, but we should also consider the *proper* whitesapce handling.
Regards
Peter
-- :) Christoph Reck
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
