Edgewall Software

Changes between Version 36 and Version 37 of WikiMacros


Ignore:
Timestamp:
Jul 23, 2010, 7:12:41 PM (14 years ago)
Author:
anonymous
Comment:

StringIO in Macro edited

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v36 v37  
    162162{{{
    163163#!python
    164     text = "whatever wiki markup you want, even containing other macros"
    165     # Convert Wiki markup to HTML, new style
    166     out = StringIO()
    167     Formatter(self.env, formatter.context).format(text, out)
    168     return Markup(out.getvalue())
     164from genshi.core import Markup
     165from trac.wiki.macros import WikiMacroBase
     166from trac.wiki import Formatter
     167import StringIO
     168
     169class HelloWorldMacro(WikiMacroBase):
     170        def expand_macro(self, formatter, name, text, args):
     171                text = "whatever '''wiki''' markup you want, even containing other macros"
     172                # Convert Wiki markup to HTML, new style
     173                out = StringIO.StringIO()
     174                Formatter(self.env, formatter.context).format(text, out)
     175                return Markup(out.getvalue())
    169176}}}