#
# Copyright 1999, 2000 Martin Pool <mbp@humbug.org.au>
# Copyright 2002 Gerardo Poggiali
-# Copyright 2007, 2008 Bernie Innocenti <bernie@codewiz.org>
+# Copyright 2007, 2008, 2009 Bernie Innocenti <bernie@codewiz.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
return '<a %shref="%s">%s</a>' % (classattr, relative_url(params, privileged=privileged), text)
+def link_inline(name, descr=None, args=''):
+ if not descr: descr = name
+ if video_re.match(name):
+ return '<video src="%s">Your browser does not support the HTML5 video tag</video>' % name
+ else:
+ return '<a href="%s"><img border="0" src="%s" alt="%s" /></a>' % (name, name + args, descr)
+
# Search ---------------------------------------------------
def handle_fullsearch(needle):
args = '?' + '&'.join(argv)
# 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>' \
- % (name, name + args, descr, descr)
- elif video_re.match(name):
- return '<video src="%s">Your browser does not support the HTML5 video tag</video>' % name
+ return '<div class="extthumb"><div class="thumb">' \
+ + link_inline(name, descr, args) \
+ + '<div class="caption">' + descr + '</div></div></div>'
else:
- return '<a href="%s"><img border="0" src="%s" /></a>' % (name, name)
+ return link_inline(name, name)
def _html_repl(self, word):
self.in_html += 1