velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Quick Escaping Question
Date Mon, 05 Nov 2001 22:05:02 GMT
On 11/5/01 5:02 PM, "Tim Chamberlain" <tchamberlain@sportingnews.com> wrote:

> Hello List,
> 
> I have a quick question about escaping characters.  In a template I am
> trying to output #.   If I simply type #, nothing is printed out.

A # should be printed out.  What version of velocity are you using?

>  The 
> manual talks about escaping $ with \$ but I did not see escaping the
> pound sign anywhere.  I tried the same technique with # (ie \#), but \
> was printed out instead of the #  I was expecting.  Is it possible to
> escape the pound character?
> 
> Thanks in advance,
> Tim

You only need to escape #<token> when <token> is a valid directive, like

\#set

Similarly, only need to escape $<foo> when <foo> is something that has a
value in the context.

Otherwise, all other cases should render 'as is'.

Geir

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin



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


Mime
View raw message