From: Bernardo Innocenti Date: Mon, 17 Dec 2007 09:41:29 +0000 (+0100) Subject: Support image links X-Git-Tag: v3.0~48 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=aa564134b01555f0288e16ae09ca5a87533d3155;p=geekigeeki.git Support image links --- diff --git a/geekigeeki.py b/geekigeeki.py index 56d71f1..83b6142 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -389,12 +389,16 @@ class PageFormatter: return apply(macro, (name, descr)) elif img_re.match(name): return '%s' % (name, name, descr) - elif url_re.match(name): - return '%s' % (name, descr) - elif name.startswith('/'): - return '%s' % (name, descr) else: - return link_tag(name, descr, 'wikilink') + if img_re.match(descr): + descr = '' + + if url_re.match(name): + return '%s' % (name, descr) + elif name.startswith('/'): + return '%s' % (name, descr) + else: + return link_tag(name, descr, 'wikilink') def _email_repl(self, word): return '%s' % (word, word)