From ff74de7a49cc2bfa936503a4b37fc5c8a650a5fc Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 6 Aug 2008 12:00:04 +0200 Subject: [PATCH] Drop old image embedding syntax. --- geekigeeki.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index f704da5..d7e1a5a 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -345,16 +345,14 @@ class WikiFormatter: def _hurl_repl(self, word): m = link_re.match(word) name = m.group(1) - descr = m.group(2) or name - - if img_re.match(name): - # DEPRECATED SYNTAX: use {{foo.jpg|descr}} instead - _inl_repl(self, word) + if m.group(2) is None: + descr = name + elif img_re.match(m.group(2)): + descr = '' else: - if img_re.match(descr): - descr = '' + descr = m.group(2) - return link_tag(name, descr, 'wikilink') + return link_tag(name, descr, 'wikilink') def _inl_repl(self, word): m = link_re.match(word) @@ -363,10 +361,12 @@ class WikiFormatter: name = relative_url(name) argv = descr.split('|') descr = argv.pop(0) + if argv: args = '?' + '&'.join(argv) else: args = '' + if descr: # The "extthumb" nonsense works around a limitation of the HTML block model return '
%s
%s
' \ -- 2.25.1