def test_link_unicode(self):
     self.assertEqual(
         c2h.linkify(u'see http://example.com/?q=ünicøde for more'),
         u'see <a href="http://example.com/?q=ünicøde">'
         u'http://example.com/?q=ünicøde</a> for more',
     )
 def test_link_with_quotes(self):
     self.assertEqual(
         c2h.linkify('see http://example.com/?q="a" for more'),
         'see <a href="http://example.com/?q=&quot;a&quot;">'
         'http://example.com/?q=&quot;a&quot;</a> for more',
     )
 def test_launchpad_bug(self):
     self.assertEqual(
         c2h.linkify('# LP: #12345'),
         '# <a href="https://pad.lv/12345">LP: #12345</a>',
     )
 def test_link_in_parens(self):
     self.assertEqual(
         c2h.linkify('see [link](http://example.com)'),
         'see [link](<a href="http://example.com">http://example.com</a>)',
     )
 def test_link_with_ampersands(self):
     self.assertEqual(
         c2h.linkify('see http://example.com/?q=a&b for more'),
         'see <a href="http://example.com/?q=a&amp;b">'
         'http://example.com/?q=a&amp;b</a> for more',
     )
 def test_html(self):
     self.assertEqual(c2h.linkify('<he&lo>'), '&lt;he&amp;lo&gt;')
 def test_link(self):
     self.assertEqual(
         c2h.linkify('see http://example.com for more'),
         'see <a href="http://example.com">http://example.com</a> for more',
     )
Example #8
0
 def test_link_unicode(self):
     self.assertEqual(
         c2h.linkify(u'see http://example.com/?q=ünicøde for more'),
         u'see <a href="http://example.com/?q=ünicøde">'
         u'http://example.com/?q=ünicøde</a> for more',
     )
 def test(self):
     self.assertEqual(c2h.linkify('hello'), 'hello')
Example #10
0
 def test_link_with_quotes(self):
     self.assertEqual(
         c2h.linkify('see http://example.com/?q="a" for more'),
         'see <a href="http://example.com/?q=&quot;a&quot;">'
         'http://example.com/?q=&quot;a&quot;</a> for more',
     )
Example #11
0
 def test_launchpad_bug(self):
     self.assertEqual(
         c2h.linkify('# LP: #12345'),
         '# <a href="https://pad.lv/12345">LP: #12345</a>',
     )
Example #12
0
 def test_link_with_ampersands(self):
     self.assertEqual(
         c2h.linkify('see http://example.com/?q=a&b for more'),
         'see <a href="http://example.com/?q=a&amp;b">'
         'http://example.com/?q=a&amp;b</a> for more',
     )
Example #13
0
 def test_link_in_parens(self):
     self.assertEqual(
         c2h.linkify('see [link](http://example.com)'),
         'see [link](<a href="http://example.com">http://example.com</a>)',
     )
Example #14
0
 def test_link(self):
     self.assertEqual(
         c2h.linkify('see http://example.com for more'),
         'see <a href="http://example.com">http://example.com</a> for more',
     )
Example #15
0
 def test_html(self):
     self.assertEqual(c2h.linkify('<he&lo>'), '&lt;he&amp;lo&gt;')
Example #16
0
 def test(self):
     self.assertEqual(c2h.linkify('hello'), 'hello')