velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apa...@recks.org
Subject Re: one question
Date Tue, 21 Mar 2006 07:55:01 GMT
I strongly recommend using a token instead of
escaping:

If you want to render:
  $\\\\!foo
do:
#set( $D = '$' )
  ${D}\\\\!foo

and you completely avoided a reference to $foo ,
which would render differently if it is defined
or not.

Cheers,
Christoph

吴耀华 wrote:
> Advanced Issues: Escaping and !
> When a reference is silenced with the ! character and the ! character preceded by an
\ escape character, the reference is handled in a special way. Note the differences between
regular escaping, and the special case where \ precedes ! follows it: 
> 
> #set( $foo = "bar" ) 
> $\!foo 
> $\!{foo} 
> $\\!foo 
> $\\\!foo 
> This renders as: 
> 
> $!foo 
> $!{foo} 
> $\!foo 
> $\\!foo 
> 
> So that I can assume if i get a clause like:
> $\\\\\!foo
> that will render as:
> $\\\\!foo
> is it right? just lose one backslash?
> 
> 
> 
> 

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


Mime
View raw message