From 8d59ef2e1040c8913346af8829f6f071dce0f950 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 23 Jun 2021 12:52:04 +1000 Subject: [PATCH] CSS Filter - restore nicer linefeeds --- backend/fetch_site_status.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/fetch_site_status.py b/backend/fetch_site_status.py index b21422ca..75a87b32 100644 --- a/backend/fetch_site_status.py +++ b/backend/fetch_site_status.py @@ -92,9 +92,7 @@ class perform_site_check(): # 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 # @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() - # Try to cut back on excessive linefeeds if there are any - text = text.replace("\n\n","\n") + text = str(item.get_text(separator="\n", strip=True)).strip() + '\n' stripped_text_from_html += text else: