... at the very least for "local" links. That is, look for <a href="HREF"> elements, and perform some checks on the HREF value:
- it should start either with
http:// or https:// or mailto:,
- it must not start with
file:// nor with /
- for relative paths, the referenced file should exist
- bonus points for checking that the link does not extend outside the GAP directory (so no
../../../../../../etc/passwd or ../../../pkg/../../../../etc/passwd or other similar nonsense)
- more bonus points if external links are also checked, but I am not sure that's feasible, soo...
There are probably existing tools out there that we can use for this. E.g. here is one written in Python 3: https://linkchecker.github.io/linkchecker/
... at the very least for "local" links. That is, look for
<a href="HREF">elements, and perform some checks on theHREFvalue:http://orhttps://ormailto:,file://nor with/../../../../../../etc/passwdor../../../pkg/../../../../etc/passwdor other similar nonsense)There are probably existing tools out there that we can use for this. E.g. here is one written in Python 3: https://linkchecker.github.io/linkchecker/