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

Macro calls without parenthesis now "eats" the following newline

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: Engine
    • Labels:
      None

      Description

      The behavior of macro calls without parenthesis changed in 2.x. I cannot find anything in the changelog about that but maybe I missed it.

      The following:

      #macro(mymacro)value#end
      #mymacro
      

      produces:

      • in Velocity 1.7: "value/n"
      • in Velocity 2.x: "value"

      but:

      #macro(mymacro)value#end
      #mymacro()
      

      produces in both Velocity versions "value" (eats the newline)

      Looks like omitting parenthesis in Velocity 1.7 was making the macro call "inline" while having them was eating the following newline like things like #set directive do.

        Attachments

          Activity

            People

            • Assignee:
              cbrisson Claude Brisson
              Reporter:
              tmortagne Thomas Mortagne
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: