From: Oleg Broytman Date: Sun, 3 Mar 2024 14:47:58 +0000 (+0300) Subject: Fix(parse_html/bkmk_ph_beautifulsoup4): Find "shortcut icon" X-Git-Tag: 5.2.3~3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=614d11c6e8456d749164684128f36bcc03080bd6;p=bookmarks_db.git Fix(parse_html/bkmk_ph_beautifulsoup4): Find "shortcut icon" Bs4 splits attribute values. To fix it the value must be re-combined back. --- diff --git a/parse_html/bkmk_ph_beautifulsoup4.py b/parse_html/bkmk_ph_beautifulsoup4.py index 7687c75..060f078 100644 --- a/parse_html/bkmk_ph_beautifulsoup4.py +++ b/parse_html/bkmk_ph_beautifulsoup4.py @@ -139,6 +139,7 @@ def _find_refresh(Tag): def _find_icon(Tag): - return (Tag.name == "link") and \ - (Tag.get_attribute_list("rel", '')[0].lower() - in ('icon', 'shortcut icon')) + if Tag.name != "link": + return False + rel = ' '.join(Tag.get_attribute_list("rel", '')) + return rel in ('icon', 'shortcut icon')