Changes between Version 5 and Version 6 of WikiMacros


Ignore:
Timestamp:
Mar 31, 2018, 10:01:04 PM (6 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v5 v6  
    9595# Note: since Trac 0.11, datetime objects are used internally
    9696
    97 from genshi.builder import tag
    98 
    9997from trac.util.datefmt import format_datetime, utc
     98from trac.util.html import tag
    10099from trac.wiki.macros import WikiMacroBase
    101100
     
    116115
    117116{{{#!python
    118 from genshi.core import Markup
    119 
     117from trac.util.html import Markup
    120118from trac.wiki.macros import WikiMacroBase
    121119
     
    173171}}}
    174172
    175 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)`) with `Markup` coming from Genshi (`from genshi.core import Markup`).
     173Note 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`).
    176174
    177175You can also recursively use a wiki Formatter (`from trac.wiki import Formatter`) to process the `text` as wiki markup:
    178176
    179177{{{#!python
    180 from genshi.core import Markup
     178from trac.util.html import Markup
    181179from trac.wiki.macros import WikiMacroBase
    182180from trac.wiki import Formatter