velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Reynolds" ...@twofeetthick.com>
Subject Re: A link
Date Fri, 29 Oct 2004 16:24:43 GMT
> Hi Manish,
>
>> I have an area in my form for user comments, the user may type
>> following text in his comments -
>> <a href=http://some.url.com/">some name</a>
>>
>> I print this text in my template as -
>> $user.comments
>>
>> However, this link is not treated as HTML but as normal text. How can
>> I treat it as HTML by default?
>> The user may or may not use HTML tags, but I'd still want to treat it
>> as HTML. How do I do this?
> I'm not quite sure what you want to do, but will this help?
>    http://wiki.apache.org/jakarta-velocity/EscapeTool

Hi, i'm new to the list and can't give offer a velocity solution, but i do
know exactly what manish is talking about. it does look the Escape Tool is
used for something else

i ran into this using the struts-bean taglibs, where you want the HTML to
be parsed:

<bean:write filter="false" name="article" property="articleBodyShort" />

The filter=false is the key. By default, it's filter="true", so if your
string contains HTML, it will *not* get parsed, it will just print to
screen as is. I specifically turn filter=false for all bean:write tags that
i know will include HTML.

Hopefully someone knows the velocity equivalent of this

JR



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