Skip to content

Commit

Permalink
feat(parser): trim linebreaks in blockquote
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Nov 4, 2023
1 parent 657fe1d commit 8d47326
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/parsing/html_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ async def _parse_item(self, soup: Union[PageElement, BeautifulSoup, Tag, Navigab

if tag == 'blockquote':
quote = await self._parse_item(soup.children)
if quote:
return Blockquote(quote)
return None
if not quote:
return None
quote.strip()
if quote.is_empty():
return None
return Blockquote(quote)

if tag == 'q':
quote = await self._parse_item(soup.children)
Expand Down

0 comments on commit 8d47326

Please sign in to comment.