diff --git a/src/parsing/html_parser.py b/src/parsing/html_parser.py index 2dd5fce954..ac7814d342 100644 --- a/src/parsing/html_parser.py +++ b/src/parsing/html_parser.py @@ -127,10 +127,13 @@ async def _parse_item(self, soup: Union[PageElement, BeautifulSoup, Tag, Navigab if text: if parent == 'li': return text - text_l = [Br(), text] - if not(isinstance(soup.next_sibling, Tag) and soup.next_sibling.name == 'blockquote'): + text_l = [text] + ps, ns = soup.previous_sibling, soup.next_sibling + if not (isinstance(ps, Tag) and ps.name == 'blockquote'): + text_l.insert(0, Br()) + if not (isinstance(ns, Tag) and ns.name == 'blockquote'): text_l.append(Br()) - return Text(text_l) + return Text(text_l) if len(text_l) > 1 else text return None if tag == 'blockquote':