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

Example of whitespace gobbling in User Guide is incorrect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: 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

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

              Dates

              • Created:
                Updated:
                Resolved: