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 = '<img border="0" src="' + descr + '" />'
else:
- if img_re.match(descr):
- descr = '<img border="0" src="' + 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)
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 '<div class="extthumb"><div class="thumb"><a href="%s"><img border="0" src="%s" alt="%s" /></a><div class="caption">%s</div></div></div>' \