Changes between Version 52 and Version 53 of WikiMacros
- Timestamp:
- Aug 9, 2017, 9:49:30 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiMacros
v52 v53 174 174 Note that the return value of `expand_macro` is '''not''' HTML escaped. Depending on the expected result, you should escape it yourself (using `return Markup.escape(result)`) or, if this is indeed HTML, wrap it in a Markup object: `return Markup(result)` (`from trac.util.html import Markup`). 175 175 176 You can also recursively use a wiki formatter to process the ` text` as wiki markup:176 You can also recursively use a wiki formatter to process the `content` as wiki markup: 177 177 178 178 {{{#!python … … 181 181 182 182 class HelloWorldMacro(WikiMacroBase): 183 def expand_macro(self, formatter, name, text, args):184 markup= "any '''wiki''' markup you want, even containing other macros"183 def expand_macro(self, formatter, name, content, args): 184 content = "any '''wiki''' markup you want, even containing other macros" 185 185 # Convert Wiki markup to HTML 186 return format_to_html(self.env, formatter.context, markup) 187 186 return format_to_html(self.env, formatter.context, content) 188 187 }}}