mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
url preview: Return generic parser <p> text as str (not bs4 string).
This commit is contained in:
committed by
Tim Abbott
parent
2b3de816a8
commit
d02eb99831
@@ -25,11 +25,11 @@ class GenericParser(BaseParser):
|
|||||||
first_h1 = soup.find('h1')
|
first_h1 = soup.find('h1')
|
||||||
if first_h1:
|
if first_h1:
|
||||||
first_p = first_h1.find_next('p')
|
first_p = first_h1.find_next('p')
|
||||||
if (first_p and first_p.string != ''):
|
if (first_p and first_p.text != ''):
|
||||||
return first_p.text
|
return first_p.text
|
||||||
first_p = soup.find('p')
|
first_p = soup.find('p')
|
||||||
if (first_p and first_p.string != ''):
|
if (first_p and first_p.text != ''):
|
||||||
return first_p.string
|
return first_p.text
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _get_image(self) -> Optional[str]:
|
def _get_image(self) -> Optional[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user