Releases: Munter/hyperlink
Sitemap support
Features
Sitemap support has been added. You can now give hyperlink your sitemap in XML, text, atom or rss format, or just supply it with your robots.txt
if you use the Sitemap:
-directives
Patches
- Fix #169: Wrong encoding of url-encoded characters when they are in a project root. See also Munter/netlify-plugin-checklinks#453
- Fix #188: Don't follow
JavaScriptFetch
relations
Bugfix release
Pretty URLs
Pretty URLs
Some web services let you link to a page without its .html
extension. Hyperlink would fail when checking such links. A newly added --pretty
boolean option enables support for these 'pretty' URLs.
Example:
<!-- /index.html -->
<a href="about">About</a>
<!-- /about.html -->
<h1>I am the about page</h1>
Name attributes as fragment identifiers
Although it's deprecated in HTML5 to use fragments to link to an elements name-attribute, the practice is still in wide use and browser also still support it.
The user interaction of clicking a link and having it work is more important than sticking to the word of the standard, so if browsers give a successful experience here, so should we.
Example:
<a href="#namefragment">goto</a>
<a name="namefragment">Welcome</a>
Check for redirects on fragment links
Pull requests
- #165 Emit an error if a relation with a fragment gets redirected (Andreas Lind, Peter Müller)
Github markdown fragments
Github markdown output where headings had slugified fragment links, but the corresponding id-attribute had a user-content-
string prepended, which github then handles with javascript, are now retried by hyperlink to see if this special case is true.
example:
<a id="user-content-6-test262-status" class="anchor" aria-hidden="true" href="#6-test262-status">
Hyperlink will no longer report these fragments as broken if the content is hosted on github.com
ES Modules
New features
- Better ES6 support including module syntax
- Less noise when checking type compatibility of assets based on their incoming relations.
Maintenance
- Upgraded Assetgraph to v5.8.3
v4
Breaking changes
- Switch to Assetgraph 4
- Drop backwards compatibility for node < 8
- Renamed a bunch of test operator names
- Renamed a bunch of test names
- Deprecated
--exclude
CLI option (#113)
New features
- Added
options.skipFilter
to allow a user to avoid specific tests (#114) - Added
--skip
CLI option to allow skipping specific tests from the command line (#114) - Added
options.todoFilter
to allow a user to mark failed tests as todo (#115) - Added
--todo
CLI option to allow mark failed tests as todo from the command line (#115) - Check mismatching Content-Type headers (#138)
- Check missing Content-Type headers (#138)
Bugfixes
Preconnect and timeout
Patches
- Don't attempt to load
<link rel="preconnect">
as a link, but only establish a connection to check availability - Set a default timeout of 30 seconds on all requests
- Use a user-agent that reveals this is hyperlink making the request
Canonical root and recursion
Breaking changes:
- The
-r
or--recursive
option no longer recurses into source maps and source map sources. This lets you set recursion without getting errors for possibly unpublished source map sources
New features:
- A
--source-map
option has been added to enable you to fail on missing source maps or source map sources. - A
--canonicalroot
option has been added. This allows hyperlink to resolve a canonical deployment URL as a local one. Sohttps://mntr.dk/opengraph.jpg
with a--canonicalroot https://mntr.dk/
would be resolved as/opengraph.jpg
when your root is a local file system.
Fixes:
- Added more resilience against servers behaving weirdly when requesting with
HEAD
-method. A server would respond 502, and also respond 502 on an immediately attempt at recovering with aGET
. Added yet another recovery retry on a timeout for this condition
Memory and Speed optimizations
Features:
- Added
--debug
option to show a memory usage increase from init to final run
Patches:
- Release memory by unloading assets with no outgoing relations. Fixes #117
- Switch external link checks to
HEAD
requests to reduce network load - Fall back to
GET
requests for external requests when encountering known errors withHEAD
requests - Send better Accept-headers to reduce errors from external servers