You could write a simple escape function.

def escape(html):
    "Return the given TEXT with ampersands, quotes and carets
encoded."
    return html.replace('&', '&amp;').replace('<',
'&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'",
'&#39;')

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to