Changes between Version 14 and Version 15 of WikiMacros


Ignore:
Timestamp:
14/06/2017 12:47:23 (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v14 v15  
    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