webhooks/jira: Fix markup conversion of full links.

This commit modifies the regex used when parsing JIRA's full links of
the form `[text|link]` so that if you have two in a message, Zulip
markup conversion doesn't think that the first link extends to the
closing `]` of the second link.
This commit is contained in:
David Wood
2019-05-23 09:17:17 +01:00
committed by Tim Abbott
parent 1fec51d73c
commit 2e9e653af1
3 changed files with 202 additions and 1 deletions

View File

@@ -124,6 +124,17 @@ Adding a comment. Oh, what a comment it is!
self.send_and_test_stream_message('commented_v1', expected_topic, expected_message)
self.send_and_test_stream_message('commented_v2', expected_topic, expected_message)
def test_commented_with_two_full_links(self) -> None:
expected_topic = "BUG-15: New bug with hook"
expected_message = """
Leo Franchi commented on [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) (assigned to **Othello, the Moor of Venice**):
``` quote
This is the [first link](https://google.com) and this is the [second link](https://google.com) and this is the end.
```
""".strip()
self.send_and_test_stream_message('commented_v2_with_two_full_links', expected_topic, expected_message)
def test_comment_edited(self) -> None:
expected_topic = "BUG-15: New bug with hook"
expected_message = """