on 1/2/2001 9:44 AM, "Jason van Zyl" <[EMAIL PROTECTED]> wrote:

> There is an Escape.java class that is currently used
> in Anakia to do this. You can simply grab that class
> place it in the context and go!
> 
> context.put("escape", new Escape());
> 
> and use it in your template as
> 
> $escape.getText($stringToEscape)
> 
> We are planning to move all useful tools into a single
> location soon and make them available as a useful set
> of context tools and the Escape class will be one
> of them.
> 
> jvz.

Maybe it would be a good idea to allow #macro's to be passed in a value if
they have a #end. Therefore, it would be easy to do something like this:

context.put("escape", new Escape());

-----------
#macro (htmlescape $pass)
$escape.getText($pass)
#end
-----------

Then in your page:

#htmlescape
<>""
#end

It would make it really easy to emulate #defines that way and seems to be a
cleaner way of implementing things than making everyone create their own
#directives like WM does. :-)

I would be +1 to have it be severely restricted though. For example, you can
only pass in one argument and that argument can only be a String.

-jon

-- 
Honk if you love peace and quiet.

Reply via email to