mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
email_mirror: Insert a new line before attachment links.
This commit is contained in:
committed by
Tim Abbott
parent
ac8f4aaa93
commit
cc8b83b261
@@ -141,6 +141,8 @@ def construct_zulip_body(message: message.Message, realm: Realm, show_sender: bo
|
|||||||
if not include_footer:
|
if not include_footer:
|
||||||
body = filter_footer(body)
|
body = filter_footer(body)
|
||||||
|
|
||||||
|
if not body.endswith('\n'):
|
||||||
|
body += '\n'
|
||||||
body += extract_and_upload_attachments(message, realm)
|
body += extract_and_upload_attachments(message, realm)
|
||||||
body = body.strip()
|
body = body.strip()
|
||||||
if not body:
|
if not body:
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ class TestEmailMirrorMessagesWithAttachments(ZulipTestCase):
|
|||||||
target_realm=user_profile.realm)
|
target_realm=user_profile.realm)
|
||||||
|
|
||||||
message = most_recent_message(user_profile)
|
message = most_recent_message(user_profile)
|
||||||
self.assertEqual(message.content, "Test body[image.png](https://test_url)")
|
self.assertEqual(message.content, "Test body\n[image.png](https://test_url)")
|
||||||
|
|
||||||
def test_message_with_invalid_attachment(self) -> None:
|
def test_message_with_invalid_attachment(self) -> None:
|
||||||
user_profile = self.example_user('hamlet')
|
user_profile = self.example_user('hamlet')
|
||||||
|
|||||||
Reference in New Issue
Block a user