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

Christopher Schultz commented on VELOCITY-614:
----------------------------------------------

Aah... right. I keep forgetting that escaping is not really a part of Velocity. 
You can put a backslash in front of a $ symbol to prevent it from being 
evaluated, and you can put a backslash in front of a # symbol (in a directive 
only) and that will prevent it from being executed (including parameters passed 
to the directive).

This simply violates the principle of least surprise: all "escaping" is really 
just special cases that look like traditional escaping.

It's also surprising to me that:

\#if($jazz)
  Vyacheslav Ganelin
\#end

Yields:

 #if($ jazz )
     Vyacheslav Ganelin
 #end

...rather than

#if([whatever $jazz evaluates to)
     Vyacheslav Ganelin
#end

Not a complaint per-se, but something to think about when the parser is 
re-written: escaping should work as expected by, say, a C programmer ;)

> Impossible to escape '#' if followed by text and parenthesis( 
> "\#something(Stuff)" renders with the '\')
> --------------------------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-614
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-614
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: I don't think it is relevant but still: CPU Intel 
> Pentium D, windows XP SP3, JRE 1.6.0_07, Velocity 1.6-beta1
>            Reporter: Guillaume Polet
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: Velocity614TestCase.java
>
>
> "#something(Stuff)" in your templates (without the double quotes) causes a 
> parse error.
> "\#something(Stuff)" in your template (without the double quotes) renders as 
> "\#something(Stuff)"
> Either the first line should go through just fine, or the next one should not 
> render the '\'
> This typically happens when you try to generate JavaDoc for overriding 
> methods.
> Don't hesitate to contact me if this is not clear enough or if you are unable 
> to reproduce this issue.

-- 
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