diff options
author | Charlie Allom <yeled@github.com> | 2018-06-08 09:47:53 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2018-06-08 10:47:53 +0200 |
commit | 41b847ecc1978249052e1ef5c6dbb161f0dc5ca2 (patch) | |
tree | 8d4aef00dd13438867f34c2a192d7ec8edf7020c /wee_slack.py | |
parent | 6df61f330460316db2a72e770214b1ba82c3cb56 (diff) | |
download | wee-slack-41b847ecc1978249052e1ef5c6dbb161f0dc5ca2.tar.gz |
print `image_url` if it exists (#504)
* print `image_url` if it exists
* add test for image_url
* requirements.txt for pytest
* fix requirements.txt
* text before image_url
* this isn’t required
* README readability for development section
thanks @trygveaa
* README reorder for this development section
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 9262e7f..dae13b0 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2812,6 +2812,11 @@ def unwrap_attachments(message_json, text_before): tx = re.sub(r' *\n[\n ]+', '\n', atext) t.append(prepend_title_text + tx) prepend_title_text = '' + + image_url = attachment.get('image_url', '') + if image_url not in text_before_unescaped and image_url != title_link: + t.append(image_url) + fields = attachment.get("fields", None) if fields: for f in fields: |