Edgewall Software

Changes between Version 52 and Version 53 of WikiMacros


Ignore:
Timestamp:
Aug 9, 2017, 9:49:30 AM (7 years ago)
Author:
Ryan J Ollos
Comment:

Use variable that agrees with documentation text.

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v52 v53  
    174174Note 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`).
    175175
    176 You can also recursively use a wiki formatter to process the `text` as wiki markup:
     176You can also recursively use a wiki formatter to process the `content` as wiki markup:
    177177
    178178{{{#!python
     
    181181
    182182class 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"
    185185        # 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)
    188187}}}