Skip to content

IgnoreURLs doesn't work on relative URLs #168

Closed
@mtlynch

Description

@mtlynch

Describe the bug

I have a server-side redirect on my production site, but on the static site, it looks like a broken link. I want to tell htmltest to ignore it, but I can't figure out how. Using IgnoreURLs seems to have no effect on a relative URL

To Reproduce

  1. Create an HTML file with a non-existent relative link
  2. Add the relative URL to IgnoreURLs

.htmltest.yml

DirectoryPath: dist
IgnoreURLs:
  - /foo/bar

Source files

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width">
  <title>Demo</title>
</head>

<body>
  <a href="/foo/bar">Foo bar</a>
</body>
</html>

Expected behaviour

htmltest ignores the broken /foo/bar relative link.

Actual behaviour

htmltest reports error: target does not exist --- index.html --> /foo/bar

Even if I change the IgnoreURLs to .*/foo/bar, it still flags this as a broken link. I'm not sure if this is a bug in htmltest or if I'm misunderstanding how to specify IgnoreURLs for relative links.

Versions

  • OS: Ubuntu 20.04
  • htmltest: htmltest v0.14.0, 2021-01-23T18:38:58Z

Additional context

Thanks so much for your work on htmltest! I'd love to make a financial donation to the project if that's an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions