do not introduce extra spaces

This commit is contained in:
Valentin Boettcher 2024-07-31 16:59:56 -04:00
parent 538afac03e
commit f1c8ea7586
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -45,7 +45,8 @@ class Options:
def get_document_title(header_string):
"""Get the title of the document from the email header."""
m = re.search(
r'"(.*?)" from your Kindle', header_string.replace("\n", " ").replace("\r", "")
r'"(.*?)" from your ',
header_string.replace("\n", " ").replace("\r", "").replace(" ", " "),
)
if not m:
@ -60,7 +61,8 @@ def get_download_link(text):
just `page` pages from the email body.
"""
m = re.search(
r"\[Download PDF\]\((.*?)\)", text.replace("\n", " ").replace("\r", "")
r"\[Download PDF\]\((.*?)\)",
text.replace("\n", " ").replace("\r", "").replace(" ", " "),
)
if not m: