From: Bernie Innocenti Date: Wed, 6 Aug 2008 10:00:04 +0000 (+0200) Subject: Drop old image embedding syntax. X-Git-Tag: v3.0~13 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ff74de7a49cc2bfa936503a4b37fc5c8a650a5fc;p=geekigeeki.git Drop old image embedding syntax. --- 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
' \