]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(parse_html/bkmk_ph_beautifulsoup4): Fix title recombination
authorOleg Broytman <phd@phdru.name>
Mon, 20 Nov 2023 01:12:54 +0000 (04:12 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 20 Nov 2023 01:17:31 +0000 (04:17 +0300)
parse_html/bkmk_ph_beautifulsoup4.py

index d76c05acd3da7f1bc6d09168562adfc1c05fa8c0..7687c755e94aa6c80a6d019239efd170554cc4b6 100644 (file)
@@ -71,7 +71,10 @@ def parse_html(html_text, charset=None, log=None):
             for part in title:
                 #if not isinstance(part, string_type):
                 #    part = part.decode()
-                parts.append(part.strip())
+                if part.strip:
+                    parts.append(part.strip())
+                else:
+                    parts.append(' ')  # Skip tags, they're usually `<br>`
             title = ''.join(parts)
 
     meta = head.find(_find_contenttype, recursive=False)