Some hacks on top of an upstream example script I found.
This commit is contained in:
parent
9940de3bde
commit
0c53f82635
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue