1
0

Remove redundant whitespace on end of line

This commit is contained in:
Jon Michael Aanes 2024-11-04 22:49:26 +01:00
parent a32e8fa77f
commit d83f8cc7fc
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,11 @@ def format_message_as_citation(out: list[str], msg: Message) -> None:
out.append(f'{msg.sent_at.date()} {msg.sent_at.time()} [[{msg.sender}]]:') out.append(f'{msg.sent_at.date()} {msg.sent_at.time()} [[{msg.sender}]]:')
out.append('\n') out.append('\n')
for line in msg.text.strip().split('\n'): for line in msg.text.strip().split('\n'):
out.append(f'> {normalize_line(line)}\n') out.append('>')
if line:
out.append(' ')
out.append(normalize_line(line))
out.append('\n')
del line del line
out.append('\n') out.append('\n')

View File

@ -6,7 +6,7 @@ from libpurple_to_markdown.markdown import format_messages
NOW = datetime.datetime.fromtimestamp(1_000_000_000, tz=datetime.UTC) NOW = datetime.datetime.fromtimestamp(1_000_000_000, tz=datetime.UTC)
TEXT_1 = 'Hello \nWorld \n ' TEXT_1 = 'Hello \n\nWorld \n '
EXPECTED_1 = """# Test EXPECTED_1 = """# Test
@ -15,10 +15,12 @@ EXPECTED_1 = """# Test
2001-09-09 01:46:40 [[Test Sender]]: 2001-09-09 01:46:40 [[Test Sender]]:
> Hello > Hello
>
> World > World
2001-09-09 01:46:40 [[Test Sender]]: 2001-09-09 01:46:40 [[Test Sender]]:
> Hello > Hello
>
> World > World
""" """