Mercurial > dandelion
changeset 482:f12b0bc37c9a
fixed block macros
| author | sheep@ghostwheel |
|---|---|
| date | Sun, 05 Oct 2008 21:10:07 +0200 |
| parents | e4464e09a2f3 |
| children | d795c8679f4d |
| files | dandelion/wikiparser.py |
| diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/dandelion/wikiparser.py Sun Oct 05 20:33:46 2008 +0200 +++ b/dandelion/wikiparser.py Sun Oct 05 21:10:07 2008 +0200 @@ -39,6 +39,12 @@ ... "<<name text>>", ... ])().render() '<p><span class="name">text</span></p>' + >>> WikiParser([ + ... "<<name", + ... "text", + ... ">>", + ... ])().render() + '<div class="name">text</div>' >>> WikiParser([ ... "{{{#!python", @@ -56,7 +62,7 @@ block = { "bullets": bullets_pat, "code": ur"^\{\{\{+\s*$", - "macro": ur"^<<\w+\s*$", + "macro": ur"^\<\<\w+\s*$", "empty": ur"^\s*$", "heading": heading_pat, "indent": ur"^[ \t]+", @@ -255,7 +261,10 @@ line = unicode(self.lines.next(), "utf-8", "replace") inside = u"\n".join(line.rstrip() for line in lines) yield html_start('div', class_=name) - yield html_text(inside) + if self.wiki_macro is None: + yield html_text(inside) + else: + yield self.wiki_macro(name, inside) yield html_end('div') def block_syntax(self, block):
