mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
improve post teasers by avoid common fail modes
This commit is contained in:
parent
91dbe4c30b
commit
afcb4be96f
1 changed files with 2 additions and 1 deletions
|
@ -427,8 +427,9 @@ def first_paragraph(html):
|
|||
first_para = soup.find('p')
|
||||
if first_para:
|
||||
if first_para.text.strip() == 'Summary' or \
|
||||
first_para.text.strip() == '*Summary*' or \
|
||||
first_para.text.strip() == 'Comments' or \
|
||||
first_para.text.lower().startswith('cross-posted from: https'):
|
||||
first_para.text.lower().startswith('cross-posted from:'):
|
||||
second_paragraph = first_para.find_next('p')
|
||||
if second_paragraph:
|
||||
return f'<p>{second_paragraph.text}</p>'
|
||||
|
|
Loading…
Add table
Reference in a new issue