Mercurial > p > roundup > code
comparison test/test_templating.py @ 6299:fd0bdcbc68e4
issue2551104 - fix issue with markdown autolink next to punctuation
Given:
[label](http://example.com/).
generated href including the ').' This fixes that.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 20 Dec 2020 12:28:59 -0500 |
| parents | 3f7538316724 |
| children | 6f89cdc7c938 |
comparison
equal
deleted
inserted
replaced
| 6298:1be7af9a2b53 | 6299:fd0bdcbc68e4 |
|---|---|
| 564 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'[label](http://example.com/ "a title")')) | 564 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'[label](http://example.com/ "a title")')) |
| 565 m = p.markdown(hyperlink=1) | 565 m = p.markdown(hyperlink=1) |
| 566 m = self.mangleMarkdown2(m) | 566 m = self.mangleMarkdown2(m) |
| 567 self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener" title="a title">label</a></p>') | 567 self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener" title="a title">label</a></p>') |
| 568 | 568 |
| 569 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'[label](http://example.com/).')) | |
| 570 m = p.markdown(hyperlink=1) | |
| 571 m = self.mangleMarkdown2(m) | |
| 572 self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener">label</a>.</p>') | |
| 573 | |
| 569 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'')) | 574 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'')) |
| 570 m = p.markdown(hyperlink=1) | 575 m = p.markdown(hyperlink=1) |
| 571 m = self.mangleMarkdown2(m) | 576 m = self.mangleMarkdown2(m) |
| 572 self.assertIn(m, [ | 577 self.assertIn(m, [ |
| 573 '<p><img src="http://example.com/" alt=""/></p>\n', | 578 '<p><img src="http://example.com/" alt=""/></p>\n', |
