]> oss.titaniummirror.com Git - webber.git/commitdiff
link.py: validate link
authorHolger Schurig <holgerschurig@gmail.com>
Thu, 24 Jun 2010 08:24:45 +0000 (10:24 +0200)
committerHolger Schurig <holgerschurig@gmail.com>
Thu, 24 Jun 2010 08:24:45 +0000 (10:24 +0200)
plugins/link.py

index 6b57e256b560f5fe5a220b94dc8f892e7451d345..f7ecb2ade75b97bb369c34e8d0fe4f64f0d72bca 100644 (file)
@@ -41,7 +41,11 @@ def do_link(m):
                                break
        if not text:
                text = link
-       # TODO: validate link
+       # validate link
+       # TODO: validating local files still not working
+       if not link.startswith("http:") and not link.endswith(".html") and not link.endswith(".png"):
+               file = get_current_file()
+               warning("%s: unknown link to '%s'" % (file.rel_path, link) )
        return '<a href="%s%s">%s</a>' % (link, anchor, text)