linkinator
Advanced tools
Comparing version 1.1.7 to 1.2.0
@@ -20,2 +20,3 @@ "use strict"; | ||
], | ||
srcset: ['img', 'source'], | ||
}; | ||
@@ -28,3 +29,4 @@ function getLinks(source, baseUrl) { | ||
$(elements).each((i, element) => { | ||
links.push(element.attribs[attr]); | ||
const values = parseAttr(attr, element.attribs[attr]); | ||
links.push(...values); | ||
}); | ||
@@ -36,2 +38,10 @@ }); | ||
exports.getLinks = getLinks; | ||
function parseAttr(name, value) { | ||
switch (name) { | ||
case 'srcset': | ||
return value.split(',').map((pair) => pair.trim().split(/\s+/)[0]); | ||
default: | ||
return [value]; | ||
} | ||
} | ||
function normalizeLink(link, baseUrl) { | ||
@@ -38,0 +48,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": "1.1.7", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "JustinBeckwith/linkinator", |
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
32539
378