Skip to content

Commit

Permalink
Merge pull request #658 from Fortran-FOSS-Programmers/fix-relurl-windows
Browse files Browse the repository at this point in the history
Don't try to fix relative links if they already start with "http"
  • Loading branch information
ZedThree authored Jul 29, 2024
2 parents 6c060c4 + 1a0cb5c commit e6aa113
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ford/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ def relative_url(entity: Union[FortranBase, str], page_url: pathlib.Path) -> str
link_str = str(entity)
link = BeautifulSoup(link_str, features="html.parser").a
if link is not None:
link_path = str(pathlib.Path(str(link["href"])).resolve())
link_href = str(link["href"])
if link_href.startswith("http"):
# This is (almost certainly) an external link, so better
# be correct already
return entity
link_path = str(pathlib.Path(link_href).resolve())
else:
link_path = link_str

Expand Down

0 comments on commit e6aa113

Please sign in to comment.