diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-20 23:55:33 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-20 23:55:33 +0200 |
commit | db6b99fc17a1e37564723452963246a9e7a2b787 (patch) | |
tree | c05e1eef7219b193b85699c5422a1b05acb9af01 /wee_slack.py | |
parent | 4556187df35b6bcbbff310ae68ac2ec4bfd9d8ad (diff) | |
download | wee-slack-db6b99fc17a1e37564723452963246a9e7a2b787.tar.gz |
Add a newline between attachments
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 950117c..334a8ba 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2600,11 +2600,11 @@ def unhtmlescape(text): def unwrap_attachments(message_json, text_before): - attachment_text = '' + attachment_texts = [] a = message_json.get("attachments", None) if a: if text_before: - attachment_text = '\n' + attachment_texts.append('') for attachment in a: # Attachments should be rendered roughly like: # @@ -2647,8 +2647,8 @@ def unwrap_attachments(message_json, text_before): fallback = attachment.get("fallback", None) if t == [] and fallback: t.append(fallback) - attachment_text += "\n".join([x.strip() for x in t if x]) - return attachment_text + attachment_texts.append("\n".join([x.strip() for x in t if x])) + return "\n".join(attachment_texts) def resolve_ref(ref): |