[Zope] making a string html safe

Dieter Maurer dieter@handshake.de
Tue, 11 Jun 2002 22:28:44 +0200


Alexander Westholm writes:
 > Hi. I'm trying to html quote a zope object's ID, so that I can have
 > spaces within it without erroring out....
"html" quote does not do anything with spaces, only with "<", ">", "&"
and '"'.

You might want "url_quote" (spaces inside URLs outside of query strings)
or "url_quote_plus" (inside of query strings).

These two functions are available via "dtml-var" attributes
(of the same name) or from the module "Products.PythonScripts.standard"
(in Python Scripts or ZPTs).


Dieter