From acc404a889d85d38c814c45e28f142ad71029bff Mon Sep 17 00:00:00 2001 From: Kazuhiro Oka Date: Mon, 17 Nov 2025 00:04:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=94=B9=E8=A1=8C=E7=B3=BB=E3=82=92?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- email_priority_classifier/type/classified_email_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email_priority_classifier/type/classified_email_data.py b/email_priority_classifier/type/classified_email_data.py index 2a1086f..5bd5bcd 100644 --- a/email_priority_classifier/type/classified_email_data.py +++ b/email_priority_classifier/type/classified_email_data.py @@ -38,7 +38,7 @@ def _extract_subject_from_payload(payload: dict) -> str: @staticmethod def _decode_body(body: str, headers: list[dict]) -> str: return (base64.urlsafe_b64decode(body).decode("utf-8") - .replace("\r", "").replace("\n", "").replace("\t", "")) + .replace("\r", " ").replace("\n", " ").replace("\t", " ")) """ for header in headers: if header.get("name", "").lower() == 'content-transfer-encoding': From f368c5462d9b7fa21cf6ef99254ae7be677867dd Mon Sep 17 00:00:00 2001 From: Kazuhiro Oka Date: Mon, 17 Nov 2025 00:09:19 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20replace=E3=82=92=E6=AD=A3=E8=A6=8F?= =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=81=AEsub=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- email_priority_classifier/type/classified_email_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email_priority_classifier/type/classified_email_data.py b/email_priority_classifier/type/classified_email_data.py index 5bd5bcd..c3cba6c 100644 --- a/email_priority_classifier/type/classified_email_data.py +++ b/email_priority_classifier/type/classified_email_data.py @@ -1,5 +1,6 @@ import base64 import json +import re _LABEL_REPLACE_DATA = { "INBOX": "Inbox", @@ -37,8 +38,7 @@ def _extract_subject_from_payload(payload: dict) -> str: @staticmethod def _decode_body(body: str, headers: list[dict]) -> str: - return (base64.urlsafe_b64decode(body).decode("utf-8") - .replace("\r", " ").replace("\n", " ").replace("\t", " ")) + return re.sub(r"\s+", " ", base64.urlsafe_b64decode(body).decode("utf-8")) """ for header in headers: if header.get("name", "").lower() == 'content-transfer-encoding':