diff options
author | facelessuser <faceless.shop@gmail.com> | 2014-09-19 17:44:05 -0600 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2014-09-26 10:27:48 -0400 |
commit | 9082ed45deef99a0ff3c20aaa9f2c9b63e576838 (patch) | |
tree | 983354f7a5cd7089ba22c89376d9601fbbda7b93 /tests | |
parent | 8f878c37dc3613b7279a0787bdcaf2d66b348d74 (diff) | |
download | markdown-9082ed45deef99a0ff3c20aaa9f2c9b63e576838.tar.gz markdown-9082ed45deef99a0ff3c20aaa9f2c9b63e576838.tar.bz2 markdown-9082ed45deef99a0ff3c20aaa9f2c9b63e576838.zip |
Fix the lost tail issue in inlineprocessors.
See #253. Prior to this patch, if any inline processors returned an element
with a tail, the tail would end up empty. This resolves that issue and will
allow for #253 to be fixed. Thanks to @facelessuser for the work on this.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_apis.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_apis.py b/tests/test_apis.py index 8cb2c66..f89dba9 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -380,6 +380,20 @@ class testETreeComments(unittest.TestCase): '<!--foo-->\n') +class testElementTailTests(unittest.TestCase): + """ Element Tail Tests """ + def setUp(self): + self.pretty = markdown.treeprocessors.PrettifyTreeprocessor() + + def testBrTailNoNewline(self): + """ Test that last <br> in tree has a new line tail """ + root = markdown.util.etree.Element('root') + br = markdown.util.etree.SubElement(root, 'br') + self.assertEqual(br.tail, None) + self.pretty.run(root) + self.assertEqual(br.tail, "\n") + + class testSerializers(unittest.TestCase): """ Test the html and xhtml serializers. """ |