linkinator
Advanced tools
Comparing version 2.14.2 to 2.14.3
@@ -69,4 +69,7 @@ "use strict"; | ||
for (const attr of tagAttr[tag]) { | ||
if (attributes[attr]) { | ||
links.push(parseLink(attributes[attr], realBaseUrl)); | ||
const linkStr = attributes[attr]; | ||
if (linkStr) { | ||
for (const link of parseAttr(attr, linkStr)) { | ||
links.push(parseLink(link, realBaseUrl)); | ||
} | ||
} | ||
@@ -100,2 +103,12 @@ } | ||
} | ||
function parseAttr(name, value) { | ||
switch (name) { | ||
case 'srcset': | ||
return value | ||
.split(',') | ||
.map((pair) => pair.trim().split(/\s+/)[0]); | ||
default: | ||
return [value]; | ||
} | ||
} | ||
function parseLink(link, baseUrl) { | ||
@@ -102,0 +115,0 @@ try { |
{ | ||
"name": "linkinator", | ||
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.", | ||
"version": "2.14.2", | ||
"version": "2.14.3", | ||
"license": "MIT", | ||
@@ -44,3 +44,3 @@ "repository": "JustinBeckwith/linkinator", | ||
"@types/mime": "^2.0.3", | ||
"@types/mocha": "^8.0.0", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^14.0.0", | ||
@@ -55,3 +55,3 @@ "@types/server-destroy": "^1.0.0", | ||
"gts": "^3.0.0", | ||
"mocha": "^8.0.0", | ||
"mocha": "^9.0.0", | ||
"nock": "^13.0.0", | ||
@@ -58,0 +58,0 @@ "pkg": "^5.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97894
1339