mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-13 19:45:56 +00:00
CSS Filter - restore nicer linefeeds
This commit is contained in:
@@ -92,9 +92,7 @@ class perform_site_check():
|
|||||||
# By default, bs4's get_text will lump the text together
|
# By default, bs4's get_text will lump the text together
|
||||||
# BS4's element strip() will lose the indentation format, I've tried using a space as separator, setting strip=False etc, but doesnt help
|
# BS4's element strip() will lose the indentation format, I've tried using a space as separator, setting strip=False etc, but doesnt help
|
||||||
# @todo ideas? if you compare the css_filtered output to non-filtered snapshot it will always lose the indentation/format
|
# @todo ideas? if you compare the css_filtered output to non-filtered snapshot it will always lose the indentation/format
|
||||||
text = str(item.get_text(separator="\n", strip=True)).strip()
|
text = str(item.get_text(separator="\n", strip=True)).strip() + '\n'
|
||||||
# Try to cut back on excessive linefeeds if there are any
|
|
||||||
text = text.replace("\n\n","\n")
|
|
||||||
stripped_text_from_html += text
|
stripped_text_from_html += text
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user