Dear Wiki user, You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change notification.
The "VelocityWhitespaceGobbleStructuredTemplates" page has been changed by ClaudeBrisson. http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbleStructuredTemplates?action=diff&rev1=3&rev2=4 -------------------------------------------------- }}} For the second case, with embedded directives in a line, surrounding whitespaces should '''not''' be gobbled. A typical example of this from is: {{{ - You selected:#if( $value ) $value#else nothing#end + You selected:#if( $value ) $value#else nothing#end/* + * Copyright 2000-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ }}} This proposal does not deal/affect VTL-references. @@ -28, +42 @@ The implementation of this proposal implies that the velocity parser must be aware of whitespaces before and after directives, and that during rendering these are handled according to the whitepace handling pragma switch. + === Early filtering implementation === + + Here is an implementation that uses a java.io.FilterInputStream to filter unwanted whitespaces while loading the resource: [[StructuredGlobbingResourceLoader]] +
