You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Alik (JIRA)" <de...@velocity.apache.org> on 2008/09/24 08:11:44 UTC

[jira] Created: (VELOCITY-616) Escaping of directives does not work if the directive is in curly brackets

Escaping of directives does not work if the directive is in curly brackets
--------------------------------------------------------------------------

                 Key: VELOCITY-616
                 URL: https://issues.apache.org/jira/browse/VELOCITY-616
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.5
            Reporter: Alik


To escape a directive, one must precede it with an escape backslash. According to the documentation:
   \#if ($foo)
      \$bar
   \#end
Should render as
   #if $foo)
      $bar
   #end
And it does. 
However, if you enclose the directive in curly brackets, the escape is ignored:
   \#{if} ($foo)
      \$bar
   \#{end}
Ignores the escape and evaluates to
   \
(assuming $foo is false).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-616) Escaping of directives does not work if the directive is in curly brackets

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated VELOCITY-616:
----------------------------------

    Attachment: Velocity616TestCase.java

Test case showing this happens with both the built-in #if and the plugged in #foreach.

> Escaping of directives does not work if the directive is in curly brackets
> --------------------------------------------------------------------------
>
>                 Key: VELOCITY-616
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-616
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>            Reporter: Alik
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: Velocity616TestCase.java
>
>
> To escape a directive, one must precede it with an escape backslash. According to the documentation:
>    \#if ($foo)
>       \$bar
>    \#end
> Should render as
>    #if $foo)
>       $bar
>    #end
> And it does. 
> However, if you enclose the directive in curly brackets, the escape is ignored:
>    \#{if} ($foo)
>       \$bar
>    \#{end}
> Ignores the escape and evaluates to
>    \
> (assuming $foo is false).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-616) Escaping of directives does not work if the directive is in curly brackets

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-616.
-----------------------------------

    Resolution: Fixed

> Escaping of directives does not work if the directive is in curly brackets
> --------------------------------------------------------------------------
>
>                 Key: VELOCITY-616
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-616
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>            Reporter: Alik
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: Velocity616TestCase.java
>
>
> To escape a directive, one must precede it with an escape backslash. According to the documentation:
>    \#if ($foo)
>       \$bar
>    \#end
> Should render as
>    #if $foo)
>       $bar
>    #end
> And it does. 
> However, if you enclose the directive in curly brackets, the escape is ignored:
>    \#{if} ($foo)
>       \$bar
>    \#{end}
> Ignores the escape and evaluates to
>    \
> (assuming $foo is false).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-616) Escaping of directives does not work if the directive is in curly brackets

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated VELOCITY-616:
----------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 1.6

Not major, as this feature was new to 1.5 and there are multiple ways to workaround.   Still, would be good to fix for 1.6.  Appears to be a parser bug...

> Escaping of directives does not work if the directive is in curly brackets
> --------------------------------------------------------------------------
>
>                 Key: VELOCITY-616
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-616
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>            Reporter: Alik
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: Velocity616TestCase.java
>
>
> To escape a directive, one must precede it with an escape backslash. According to the documentation:
>    \#if ($foo)
>       \$bar
>    \#end
> Should render as
>    #if $foo)
>       $bar
>    #end
> And it does. 
> However, if you enclose the directive in curly brackets, the escape is ignored:
>    \#{if} ($foo)
>       \$bar
>    \#{end}
> Ignores the escape and evaluates to
>    \
> (assuming $foo is false).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org