Skip to content

Commit 02e68a3

Browse files
authored
Fix links at the beginning of Slack messages
1 parent f41ef32 commit 02e68a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

errbot/backends/slack.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
'cyan': '#00FFFF'
6262
} # Slack doesn't know its colors
6363

64-
MARKDOWN_LINK_REGEX = re.compile(r'([^!])\[(?P<text>.+?)\]\((?P<uri>[a-zA-Z0-9]+?:\S+?)\)')
64+
MARKDOWN_LINK_REGEX = re.compile(r'(?<!!)\[(?P<text>.+?)\]\((?P<uri>[a-zA-Z0-9]+?:\S+?)\)')
6565

6666

6767
def slack_markdown_converter(compact_output=False):
@@ -82,7 +82,7 @@ class LinkPreProcessor(Preprocessor):
8282
"""
8383
def run(self, lines):
8484
for i, line in enumerate(lines):
85-
lines[i] = MARKDOWN_LINK_REGEX.sub(r'\1&lt;\3|\2&gt;', line)
85+
lines[i] = MARKDOWN_LINK_REGEX.sub(r'&lt;\2|\1&gt;', line)
8686
return lines
8787

8888

0 commit comments

Comments
 (0)