You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not touch the URLs e.g. return tel:004346382763 and mailto:office@foo.com
Actual behavior
it throws
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:387:5)
at URL.onParseError (node:internal/url:564:9)
at new URL (node:internal/url:644:5)
at normalizeUrl (file:///Users/html/rocket/node_modules/normalize-url/index.js:97:20)
at file:///Users/html/rocket/packages/check-html-links/foo.js:3:13
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:541:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12) {
input: 'http:tel:004346382763',
code: 'ERR_INVALID_URL'
}
I run all
< href="x">
url through normalize... but it does fail on standard protocols likemailto:, tel:
.should that be supported or do I need to "filter" non-http-like URLs before?
Code to reproduce
Expected behavior
Do not touch the URLs e.g. return
tel:004346382763
andmailto:office@foo.com
Actual behavior
http://foo.com
Investigation
it always seems to prepend
http:
which leads to the invalidhttp:tel:004346382763
URL which then throws on thenew URL
here https://github.com/sindresorhus/normalize-url/blob/main/index.js#L96The text was updated successfully, but these errors were encountered: