Add arguments for specifying tags to strip/convert

This commit is contained in:
Matthew Tretter
2012-07-13 17:25:10 -04:00
parent 293937c991
commit 697f7d3276
2 changed files with 44 additions and 12 deletions

View File

@@ -14,6 +14,29 @@ class BasicTests(unittest.TestCase):
self.assertEqual(md(' a b \n\n c '), ' a b c ')
class ArgTests(unittest.TestCase):
def test_strip(self):
self.assertEqual(
md('<a href="https://github.com/matthewwithanm">Some Text</a>', strip=['a']),
'Some Text')
def test_do_not_strip(self):
self.assertEqual(
md('<a href="https://github.com/matthewwithanm">Some Text</a>', strip=[]),
'[Some Text](https://github.com/matthewwithanm)')
def test_convert(self):
self.assertEqual(
md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=['a']),
'[Some Text](https://github.com/matthewwithanm)')
def test_do_not_convert(self):
self.assertEqual(
md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=[]),
'Some Text')
class EscapeTests(unittest.TestCase):
def test_underscore(self):