Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-857

Example of whitespace gobbling in User Guide is incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None

    Description

      Under the section VTL: Formatting Issues, the whitespace gobbling example given is incorrect.

      Velocity's behaviour is to gobble up excess whitespace. The preceding directive can be written as:

      Send me
      #set( $foo = ["$10 and ","a pie"] )
      #foreach( $a in $foo )
      $a
      #end
      please.
      

      or as

      Send me
      #set($foo       = ["$10 and ","a pie"])
                       #foreach           ($a in $foo )$a
               #end please.
      

      In each case the output will be the same.

      The actual results of these templates:

      Send me
      $10 and 
      a pie
      please.
      
      Send me
                       $10 and 
               a pie
                please.
      

      Attachments

        Activity

          People

            cbrisson Claude Brisson
            pimlottc Chris Pimlott
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: