From d2fd3cfee58e6c44c4a9b5838cdac5edfec5a66c Mon Sep 17 00:00:00 2001 From: iorgun <160323588+iorgun@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:41:14 +0100 Subject: [PATCH] update inline condition for `link` element Updated the condition for checking whether the link in a `link` element is inline or not, by checking whether the 'rel' attribute contains 'manifest', 'preload', or 'prefetch', to bring it more in line with the implementation in Wget2: https://gitlab.com/gnuwget/wget2/-/blob/761ae5082dae8a0b58727cd9e10dffd32cf8d03b/libwget/html_url.c#L223 --- wpull/scraper/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpull/scraper/html.py b/wpull/scraper/html.py index 79312a5b..956c09e0 100644 --- a/wpull/scraper/html.py +++ b/wpull/scraper/html.py @@ -399,7 +399,7 @@ def iter_links_link_element(self, element): rel = element.attrib.get('rel', '') stylesheet = 'stylesheet' in rel icon = 'icon' in rel - inline = stylesheet or icon + inline = any((stylesheet, icon, 'manifest' in rel, 'preload' in rel, 'prefetch' in rel)) if stylesheet: link_type = LinkType.css