Changes between Version 1 and Version 2 of WikiMacros


Ignore:
Timestamp:
Mar 20, 2012, 4:04:32 PM (13 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v1 v2  
    105105
    106106
    107 === {{{expand_macro}}} details ===
    108 {{{expand_macro}}} should return either a simple Python string which will be interpreted as HTML, or preferably a Markup object (use {{{from trac.util.html import Markup}}}).  {{{Markup(string)}}} just annotates the string so the renderer will render the HTML string as-is with no escaping. You will also need to import Formatter using {{{from trac.wiki import Formatter}}}.
     107=== {{{
     108expand_macro
     109}}} details ===
     110{{{
     111expand_macro
     112}}} should return either a simple Python string which will be interpreted as HTML, or preferably a Markup object (use {{{
     113from trac.util.html import Markup
     114}}}).  {{{
     115Markup(string)
     116}}} just annotates the string so the renderer will render the HTML string as-is with no escaping. You will also need to import Formatter using {{{
     117from trac.wiki import Formatter
     118}}}.
    109119
    110120If your macro creates wiki markup instead of HTML, you can convert it to HTML like this:
     
    118128  return Markup(out.getvalue())
    119129}}}
     130