================== Tweaking HTML text ================== $Id$ >>> from cybertools.util.html import sanitize >>> input = """ ...
... Text ...
... """ >>> sanitize(input, validAttrs=['style']) u'\n\nText\n
\n' >>> sanitize(input, ['p', 'b'], ['class']) u'\n\nText\n
\n' All comments are stripped from the HTML input. >>> input2 = """ ...text
... ...text
""" >>> sanitize(input2) u'\ntext
\n\ntext
'