aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2013-06-16 20:54:44 -0400
committerWaylan Limberg <waylan@gmail.com>2013-06-16 20:54:44 -0400
commitbf0791a5687a4c1248d69ce040620b3bb79a95ac (patch)
treed5b51a7ac133486eab03e03f99524bb17a985398 /tests
parentf37e3b99e41ceec54684c67538665d19687478c3 (diff)
downloadmarkdown-bf0791a5687a4c1248d69ce040620b3bb79a95ac.tar.gz
markdown-bf0791a5687a4c1248d69ce040620b3bb79a95ac.tar.bz2
markdown-bf0791a5687a4c1248d69ce040620b3bb79a95ac.zip
AbbrExtension now handles abbreviations nested in other markup.
Just set each abreviation as an AtomicString. Given the nature of abbreviations, they are not likely to ever contain any other markup anyway. Also added a test. Fixes #224. Thanks for the report @JakeChampion.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_extensions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index cb27a30..cce2adf 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -27,6 +27,15 @@ class TestAbbr(unittest.TestCase):
'and a <abbr title="Abbreviation Reference">REF</abbr>. Ignore '
'REFERENCE and ref.</p>')
+ def testNestedAbbr(self):
+ """ Test Nested Abbreviations. """
+ text = '[ABBR](/foo) and _ABBR_\n\n' + \
+ '*[ABBR]: Abreviation'
+ self.assertEqual(self.md.convert(text),
+ '<p><a href="/foo"><abbr title="Abreviation">ABBR</abbr></a> '
+ 'and <em><abbr title="Abreviation">ABBR</abbr></em></p>')
+
+
class TestCodeHilite(unittest.TestCase):
""" Test codehilite extension. """