- classattr += 'rel="nofollow"'
-
- return '<a %shref="%s">%s</a>' % (classattr, relative_url(params, privileged=privileged), text)
+ nofollow = 'rel="nofollow" '
+
+ return '<a class="%s" %shref="%s">%s</a>' % (link_class, nofollow, relative_url(dest, privileged=privileged), text)
+
+def link_inline(name, descr=None, kvargs={}):
+ if not descr: descr = humanlink(name)
+ url = relative_url(name)
+ if video_re.match(name):
+ return '<video controls="1" src="%s">Your browser does not support the HTML5 video tag</video>' % url
+ elif image_re.match(name):
+ return '<a href="%s"><img border="0" src="%s" alt="%s" /></a>' % (url, url + url_args(kvargs), descr)
+ elif file_re.match(name) and not ext_re.search(name): # FIXME: this guesses a wiki page
+ return Page(name).send_naked(kvargs)
+ else:
+ return '<iframe width="100%%" scrolling="auto" frameborder="0" src="%s"><a href="%s">%s</a></iframe>' \
+ % (url, url, name)