diff --git a/verify-markdown-links.py b/verify-markdown-links.py index 3da50d2..351d929 100755 --- a/verify-markdown-links.py +++ b/verify-markdown-links.py @@ -29,11 +29,13 @@ for (text, link) in find_md_links(body_markdown): errMsg = None if not re.match(r'^(mailto|http|ftp|#)', link, re.IGNORECASE): path = Path(link) - if not path.is_file(): + if not path.is_file() and not path.is_dir(): errMsg = "local file by that name does not exist for relative file link" + else: + print(path) # FIXME: test other types of links if errMsg: - print("Bad link of \"%s\" (labeled as \"%s\") has error: %s" % (link, text, errMsg)) + print("# Bad link of \"%s\" (labeled as \"%s\") has error: %s" % (link, text, errMsg)) exit(0) # Below doesn't work, didn't have time to find out why