Help On Installing the unsecure HTML Extension

The HTML extension is unsecure because it possible that someone does Cross Site Scripting.

But if you only use it in an intranet, or only trusted users may modify pages, you can install it like this:

HTML Macro

Copy this code to the file HTML.py inside the data/plugin/macro/ directory of your MoinMoin Wiki.

Use it like this:

[[HTML(<div id="foo">)]]

Normal wiki markup...

[[HTML(</div>)]]

HTML Parser

Another option is to use this parser:

   1 Dependencies = []
   2 
   3 class Parser:
   4     Dependencies = []
   5     
   6     def __init__(self, raw, request, **kw):
   7         self.raw = raw
   8         self.request = request
   9 
  10     def format(self, formatter):
  11         self.request.write(formatter.rawHTML(self.raw))
html.py

Save it as wiki/data/plugin/parser/html.py

Use it like this:

   1 {{{
   2 #!html
   3 <div id="foo">
   4     <p>This is plain html inside a wiki page</p>
   5 </div>
   6 }}}
html-parser-example.txt

MoinMoin: HelpOnInstallingHTMLExtension (last edited 2008-06-08 16:31:41 by ThomasWaldmann)