[ 
https://issues.apache.org/jira/browse/VELOCITY-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665724#action_12665724
 ] 

Byron Foster commented on VELOCITY-670:
---------------------------------------

This behavior is also inconsistent with macros in a #parse file and macros 
defined in the macro libraries.  In the former case if macro 'foo' is defined 
in a parse file then "\#foo" renders to "\#foo" but if foo is defined in a 
library, then "\#foo" renders to "#foo"

I general it is very difficult to know when text that appears to be a  macro 
needs to be escape, and what the resulting render will look like.  This problem 
is amplified by strict mode which will throw an exception if the macro or 
directive is not defined and not escaped.

For all the discussion in the docs about escaping, there is no explanation 
about the intended behavior of defined vs not-defined and escaping rules.

> Macro escaping inconsistent with forward references
> ---------------------------------------------------
>
>                 Key: VELOCITY-670
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-670
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>            Priority: Minor
>
> Escaping a macro behaves differently if the macro is forward referenced. for 
> example the following:
> #macro(foo)bar#end
> \#foo
> gives result:
> #foo
> However this:
> \#foo
> #macro(foo)bar#end
> gives result:
> \#foo

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to