From ea440b7a93009308e8d87351725b600f1929b181 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 20 Nov 2023 04:12:54 +0300 Subject: [PATCH] Fix(parse_html/bkmk_ph_beautifulsoup4): Fix title recombination --- parse_html/bkmk_ph_beautifulsoup4.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parse_html/bkmk_ph_beautifulsoup4.py b/parse_html/bkmk_ph_beautifulsoup4.py index d76c05a..7687c75 100644 --- a/parse_html/bkmk_ph_beautifulsoup4.py +++ b/parse_html/bkmk_ph_beautifulsoup4.py @@ -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 `
` title = ''.join(parts) meta = head.find(_find_contenttype, recursive=False) -- 2.39.5