]> oss.titaniummirror.com Git - webber.git/commitdiff
link: use URL if no text has been specified
authorHolger Schurig <holgerschurig@gmx.de>
Fri, 26 Jun 2009 10:11:41 +0000 (12:11 +0200)
committerHolger Schurig <holgerschurig@gmx.de>
Fri, 26 Jun 2009 10:11:41 +0000 (12:11 +0200)
plugins/link.py

index 5190061c9c4ebed179db6c6bab9d2300a05f0aa9..d8c42149434ed60f5c1bb71c026a01307ce35755 100644 (file)
@@ -26,7 +26,6 @@ def do_link(m):
        link = m.group(2).replace("\n", " ")
        anchor = m.group(3) or ""
        if link.find(".") == -1:
-               #link = link.tolower()
                for f in files:
                        file = files[f]
                        if not file.has_key("linktitle"):
@@ -40,6 +39,8 @@ def do_link(m):
                                link = get_link_from(get_current_file().linktitle, file.linktitle)
                                #print "LINK: '%s' '%s'" % (text, link)
                                break
+       if not text:
+               text = link
        # TODO: validate link
        return '<a href="%s%s">%s</a>' % (link, anchor, text)