#format python
"""
Raw HTML Macro
Originally by Christian Bird
Modified by Adam Shand on 14 April 2003
Now allows arbitrary HTML if the page is immutable.
Much thanks to Thomas and Jürgen for all the help.
Usage: [[HTML(This is HTML.)]]
"""
import cgi
def execute(macro, args):
_ = macro.request.getText
page = macro.formatter.page
if page.isWritable():
ret = '%s
' % _('Raw HTML not returned because page is writable.')
ret += cgi.escape(args)
else:
ret = "\n\n %s \n\n" % args
return macro.formatter.rawHTML(ret)