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