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()) |
| 164 | from genshi.core import Markup |
| 165 | from trac.wiki.macros import WikiMacroBase |
| 166 | from trac.wiki import Formatter |
| 167 | import StringIO |
| 168 | |
| 169 | class 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()) |