Skip to content

Commit

Permalink
fix: broken doc links lol
Browse files Browse the repository at this point in the history
  • Loading branch information
cfoust committed Jul 21, 2024
1 parent 43d1ec4 commit 02565e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/gendoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def handler(match: re.Match) -> Tuple[
Optional[Replacement],
Optional[Error],
]:
target = match.group(1)
target = match.group(2)

if target.startswith("http"):
return None, None
Expand Down Expand Up @@ -556,9 +556,13 @@ def handler(match: re.Match) -> Tuple[
f"broken link: {target} -> {md_file}",
)

return None, None
return (
match.start(0),
match.end(0),
match.group(1) + f"({SITE_URL}{target})",
), None

return handle_pattern(re.compile(r"\[[^]]+\]\(([^)]+)\)"), handler)
return handle_pattern(re.compile(r"(\[[^]]+\])\(([^)]+)\)"), handler)


if __name__ == '__main__':
Expand Down

0 comments on commit 02565e3

Please sign in to comment.