From 6094f3f886d622f6ef89eb4791f485e2fd9aa7d9 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Thu, 26 Oct 2023 12:01:19 +0200 Subject: [PATCH] make more explicit the text parsing --- circuit_maintenance_parser/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circuit_maintenance_parser/parser.py b/circuit_maintenance_parser/parser.py index 4369bc04..68b9d95a 100644 --- a/circuit_maintenance_parser/parser.py +++ b/circuit_maintenance_parser/parser.py @@ -317,8 +317,9 @@ def parser_hook(self, raw: bytes, content_type: str): if content_type in ["html", "text/html"]: soup = bs4.BeautifulSoup(quopri.decodestring(raw), features="lxml") content = soup.text - else: + elif content_type in ["text/plain"]: content = self.get_text_hook(raw) + for data in self.parse_content(content): result.append(data) return result