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

lost '#'s inside #literal()/#end

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.6
    • Engine
    • None
    • Operating System: All
      Platform: All
    • 33590

    Description

      I am using VTL (with VPP) to customize a portion of a Perl script. Since Perl
      code has a lot of dollar signs, I am using #literal()/#end to prevent Velocity
      from processing most of the file. What I find is that single '#' characters
      that are not followed by alpha text are removed (inside #literal()/#end).

      For example:

      #literal()
      #!/usr/bin/perl
      #end

      becomes:

      !/usr/bin/perl

      I've tried things like escaping the '#' ('#') but that leaves the backslash
      ('#!/usr/bin/perl' becomes '!/usr/bin/perl'). Nothing seems to work.

      I can use a #set to define a variable with the value '#!/usr/bin/perl', but I
      was hoping I would not have to. It also doesn't help with other single #'s in
      the file (like Perl comments). For those I have had to double up the hashes.

      I'd be happy to try patching the Velocity source, but I had trouble making heads
      or tails of the parser engine?

      Attachments

        1. velocity-1.6-dev-355-perf.patch
          3 kB
          Jarkko Viinamäki

        Activity

          People

            Unassigned Unassigned
            glowney@rei.com Geoffrey Lowney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: