Skip to content

Commit ee39e40

Browse files
authored
Release: fix 改行系を空白ではなくスペースに (#12)
2 parents 24cd87c + f368c54 commit ee39e40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

email_priority_classifier/type/classified_email_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import base64
22
import json
3+
import re
34

45
_LABEL_REPLACE_DATA = {
56
"INBOX": "Inbox",
@@ -37,8 +38,7 @@ def _extract_subject_from_payload(payload: dict) -> str:
3738

3839
@staticmethod
3940
def _decode_body(body: str, headers: list[dict]) -> str:
40-
return (base64.urlsafe_b64decode(body).decode("utf-8")
41-
.replace("\r", "").replace("\n", "").replace("\t", ""))
41+
return re.sub(r"\s+", " ", base64.urlsafe_b64decode(body).decode("utf-8"))
4242
"""
4343
for header in headers:
4444
if header.get("name", "").lower() == 'content-transfer-encoding':

0 commit comments

Comments
 (0)