wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

Ignore schema URIs when testing external links #190

Open samwilson opened 2 years ago

samwilson commented 2 years ago

The bug

URIs from schema links do not have to exist, but are being checked by htmltest. For example, the following is a valid schema declaration:

<link rel="schema.PA" href="http://www.pictureaustralia.org/schemas/pa/" />

But it results in an error like this:

example.html
  Get "http://www.pictureaustralia.org/schemas/pa/": dial tcp: lookup www.pictureaustralia.org: no such host --- example.html --> http://www.pictureaustralia.org/schemas/pa/

To Reproduce

Steps to reproduce the behaviour:

  1. Create an HTML file with the <link> line given above.
  2. Run htmltest on it.
  3. See error.

.htmltest.yml

No config file required.

Source files

See above.

Expected behaviour

No error should be raised for schema URIs. In fact, there's no point in even trying to check them. They're namespaces, not retrievable resources.

Actual behaviour

The URI is treated as a URL and checked for existence, and an error is thrown.

Versions