diff options
author | calve <calvinh34@gmail.com> | 2015-10-28 11:49:54 +0100 |
---|---|---|
committer | calve <calvinh34@gmail.com> | 2016-01-04 11:11:19 +0100 |
commit | 2592aaf3322ba8af93e36a52602d75ea55e6ce79 (patch) | |
tree | 0b5d8ee8f198bac1ad4f96169fec7fec5b64b503 | |
parent | c9f9533200fbb8a7e7bc9a9f21f8db175a8d019c (diff) | |
download | wee-slack-2592aaf3322ba8af93e36a52602d75ea55e6ce79.tar.gz |
Match references to channels
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 63b7a13..e9733ef 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1674,8 +1674,8 @@ def unfurl_refs(text, ignore_alt_text=False): input : <@U096Q7CQM|someuser> has joined the channel ouput : someuser has joined the channel """ - # Find all string enclosed by <> and starting with an @ - matches = re.findall(r"(<@(?:\S*)>)", text) + # Find all string enclosed by <> and starting with an ``@`` on a ``#`` + matches = re.findall(r"(<[@#](?:\S*)>)", text) for m in matches: # Replace them with human readable strings text = text.replace(m, unfurl_ref(m[1:-1], ignore_alt_text)) |