@zachleat/fetch-links 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/links.js CHANGED
@@ -36,7 +36,15 @@ export class Links {
36
36
 
37
37
  let posthtmlOptions = {
38
38
  eachURL: function(url, attr, tagName, node) {
39
- if(url.startsWith("#") || url.startsWith("javascript:") || tagName === "img" || tagName === "video" || tagName === "source") {
39
+ if(url.startsWith("#") ||
40
+ url.startsWith("javascript:") ||
41
+ // app icons
42
+ (tagName === "link" && (node.attrs.rel === "icon" || node.attrs.rel === "apple-touch-icon" || node.attrs.rel === "apple-touch-icon-precomposed")) ||
43
+ // media
44
+ tagName === "img" ||
45
+ tagName === "audio" ||
46
+ tagName === "video" ||
47
+ tagName === "source") {
40
48
  return url;
41
49
  }
42
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zachleat/fetch-links",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Utility to fetch hyperlinks from a URL.",
5
5
  "main": "links.js",
6
6
  "type": "module",
package/test/test.js CHANGED
@@ -12,6 +12,7 @@ test("zachleat.com", async (t) => {
12
12
  // let originalUrl = "https://aaadaaam.com/";
13
13
  // let originalUrl = "https://torvalds-family.blogspot.com/";
14
14
  // let originalUrl = "https://wesbos.com/";
15
+ // let originalUrl = "https://chriscoyier.net/";
15
16
 
16
17
  let filtered = await Links.find(originalUrl);
17
18
  // console.log( filtered );