You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Nathan Bubna <nb...@gmail.com> on 2007/03/05 17:22:12 UTC

Re: escaping javascript and html

You can also use the EscapeTool:

http://velocity.apache.org/tools/devel/generic/EscapeTool.html

On 2/28/07, Федор Дыдыкин <fe...@mail.ru> wrote:
> Hi!
>
> I need to escape special symbols (' and " for now) both in JavaScript and HTML in many of my already written templates.
>
> Now i've found how to do it either in JavaScript or HTML using velocity.properties for velocity 1.5 beta2:
>
> eventhandler.referenceinsertion.class = org.apache.velocity.app.event.implement.EscapeJavaScriptReference
>
> or
>
> eventhandler.referenceinsertion.class = org.apache.velocity.app.event.implement.EscapeHtmlReference
>
> But how can i use both of these features? Different regexps for JavaScript and HTML velocity variables (how to do this if it is possible?)? Or is there any more simple solution?
>
> Fedor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>