velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Quick Escaping Question
Date Mon, 05 Nov 2001 22:05:02 GMT
On 11/5/01 5:02 PM, "Tim Chamberlain" <> 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


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 Magnusson Jr.
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:   <>
For additional commands, e-mail: <>

View raw message