feedscout 2.0.0-beta.2 → 2.0.0-beta.3
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.
|
@@ -42,7 +42,8 @@ const defaultHtmlOptions = {
|
|
|
42
42
|
linkSelectors,
|
|
43
43
|
anchorUris: urisComprehensive,
|
|
44
44
|
anchorIgnoredUris: [],
|
|
45
|
-
anchorLabels
|
|
45
|
+
anchorLabels,
|
|
46
|
+
anchorAttributes: ["aria-label", "title"]
|
|
46
47
|
};
|
|
47
48
|
const defaultHeadersOptions = { linkSelectors };
|
|
48
49
|
const defaultGuessOptions = { uris: urisBalanced };
|
|
@@ -27,9 +27,13 @@ const handleOpenTag = (context, name, attribs, _isImplied) => {
|
|
|
27
27
|
} catch {}
|
|
28
28
|
if (pathname && includesAnyOf(pathname, context.options.anchorPathSegments)) context.discoveredUris.add(attribs.href);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
}
|
|
31
|
+
if (context.currentAnchor.href && context.options.anchorAttributes?.length) for (const attribute of context.options.anchorAttributes) {
|
|
32
|
+
const value = attribs[attribute];
|
|
33
|
+
if (value && includesAnyOf(value, context.options.anchorLabels)) {
|
|
34
|
+
context.discoveredUris.add(context.currentAnchor.href);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
39
|
const handleText = (context, text) => {
|
package/dist/feeds/defaults.d.ts
CHANGED
|
@@ -13,9 +13,10 @@ declare const ignoredUris: Array<Pattern>;
|
|
|
13
13
|
declare const anchorLabels: string[];
|
|
14
14
|
declare const linkSelectors: Array<LinkSelector>;
|
|
15
15
|
declare const anchorPathSegments: RegExp[];
|
|
16
|
+
declare const anchorAttributes: string[];
|
|
16
17
|
declare const defaultHtmlOptions: Omit<HtmlMethodOptions, 'baseUrl'>;
|
|
17
18
|
declare const defaultHeadersOptions: Omit<HeadersMethodOptions, 'baseUrl'>;
|
|
18
19
|
declare const defaultGuessOptions: Omit<GuessMethodOptions, 'baseUrl'>;
|
|
19
20
|
declare const defaultPlatformOptions: Omit<PlatformMethodOptions, 'baseUrl'>;
|
|
20
21
|
//#endregion
|
|
21
|
-
export { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
22
|
+
export { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/dist/feeds/defaults.js
CHANGED
|
@@ -174,12 +174,18 @@ const anchorPathSegments = [
|
|
|
174
174
|
/\/atom\//,
|
|
175
175
|
/\/feed\//
|
|
176
176
|
];
|
|
177
|
+
const anchorAttributes = [
|
|
178
|
+
"aria-label",
|
|
179
|
+
"title",
|
|
180
|
+
"data-framer-name"
|
|
181
|
+
];
|
|
177
182
|
const defaultHtmlOptions = {
|
|
178
183
|
linkSelectors,
|
|
179
184
|
anchorUris: urisComprehensive.flat(),
|
|
180
185
|
anchorPathSegments,
|
|
181
186
|
anchorIgnoredUris: ignoredUris,
|
|
182
|
-
anchorLabels
|
|
187
|
+
anchorLabels,
|
|
188
|
+
anchorAttributes
|
|
183
189
|
};
|
|
184
190
|
const defaultHeadersOptions = { linkSelectors };
|
|
185
191
|
const defaultGuessOptions = { uris: urisBalanced };
|
|
@@ -276,4 +282,4 @@ const defaultPlatformOptions = { handlers: [
|
|
|
276
282
|
zennHandler
|
|
277
283
|
] };
|
|
278
284
|
//#endregion
|
|
279
|
-
export { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
285
|
+
export { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/dist/feeds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
1
|
+
import { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
2
2
|
import { FeedResult } from "./feeds/types.js";
|
|
3
3
|
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
4
|
-
export { FeedResult, anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
4
|
+
export { FeedResult, anchorAttributes, anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/dist/feeds.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
1
|
+
import { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
2
2
|
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
3
|
-
export { anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
3
|
+
export { anchorAttributes, anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/package.json
CHANGED