Changes between Version 7 and Version 8 of WikiMacros
- Timestamp:
- Jun 25, 2017, 1:22:26 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiMacros
v7 v8 95 95 # Note: since Trac 0.11, datetime objects are used internally 96 96 97 from genshi.builder import tag98 99 97 from trac.util.datefmt import format_datetime, utc 98 from trac.util.html import tag 100 99 from trac.wiki.macros import WikiMacroBase 101 100 … … 116 115 117 116 {{{#!python 118 from genshi.core import Markup 119 117 from trac.util.html import Markup 120 118 from trac.wiki.macros import WikiMacroBase 121 119 … … 173 171 }}} 174 172 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.coreimport Markup`).173 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)` (`from trac.util.html import Markup`). 176 174 177 175 You can also recursively use a wiki Formatter (`from trac.wiki import Formatter`) to process the `text` as wiki markup: 178 176 179 177 {{{#!python 180 from genshi.coreimport Markup178 from trac.util.html import Markup 181 179 from trac.wiki.macros import WikiMacroBase 182 180 from trac.wiki import Formatter