From 9082ed45deef99a0ff3c20aaa9f2c9b63e576838 Mon Sep 17 00:00:00 2001 From: facelessuser Date: Fri, 19 Sep 2014 17:44:05 -0600 Subject: 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. --- tests/test_apis.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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): '\n') +class testElementTailTests(unittest.TestCase): + """ Element Tail Tests """ + def setUp(self): + self.pretty = markdown.treeprocessors.PrettifyTreeprocessor() + + def testBrTailNoNewline(self): + """ Test that last
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. """ -- cgit v1.2.3