1 """
   2     Raw HTML Macro
   3 
   4     Originally by Christian Bird <chris.bird@lineo.com>
   5     Modified by AdamShand <adam@personaltelco.net> on 14 April 2003
   6     Now Allows arbitrary HTML if the page is immutable.
   7 
   8     Much thanks to Thomas Waldmann for all the help.
   9 
  10     Usage: [[HTML(<b>This is HTML.</b>)]]
  11 """
  12 
  13 def execute(macro, args):
  14     _ = macro.request.getText
  15     page = macro.formatter.page
  16 
  17     if page.isWritable():
  18         ret = '<p><strong class="error">%s</strong></p>' % _('Raw HTML not returned because page is writable.')
  19     else:
  20         ret = "\n<!-- Begin HTML.py Output -->\n %s \n<!-- End HTML.py Output -->\n" % args
  21 
  22     return ret

HtmlMacro (last edited 2003-04-14 23:52:21 by AdamShand)