Edgewall Software

Changes between Version 50 and Version 51 of WikiMacros


Ignore:
Timestamp:
Feb 1, 2017, 8:06:39 PM (7 years ago)
Author:
Ryan J Ollos
Comment:

Apply best practices for importing from trac.util.html rather than genshi.

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v50 v51  
    9696# Note: since Trac 0.11, datetime objects are used internally
    9797
    98 from genshi.builder import tag
    99 
    10098from trac.util.datefmt import format_datetime, utc
     99from trac.util.html import tag
    101100from trac.wiki.macros import WikiMacroBase
    102101
     
    117116
    118117{{{#!python
    119 from genshi.core import Markup
    120 
     118from trac.util.html import Markup
    121119from trac.wiki.macros import WikiMacroBase
    122120
     
    174172}}}
    175173
    176 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`).
     174Note 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`).
    177175
    178176You can also recursively use a wiki Formatter (`from trac.wiki import Formatter`) to process the `text` as wiki markup:
    179177
    180178{{{#!python
    181 from genshi.core import Markup
     179from trac.util.html import Markup
    182180from trac.wiki.macros import WikiMacroBase
    183181from trac.wiki import Formatter