From 1a42fa8602a99e0a8807f517ac44ecda77d86c22 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 16 Jun 2011 08:31:02 -0400 Subject: Added our own xhtml searializer. We no longer use a xml searializer to output xhtml. This fixes #9 among other bugs. The test suite even had bad tests that should have been failing. They also have been corrected. --- tests/extensions/extra/tables.html | 12 ++++++------ tests/misc/attributes2.html | 6 +++--- tests/misc/blank-block-quote.html | 2 +- tests/test_apis.py | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html index c931e6a..1d626da 100644 --- a/tests/extensions/extra/tables.html +++ b/tests/extensions/extra/tables.html @@ -85,13 +85,13 @@ - + Q - + W - + W @@ -106,13 +106,13 @@ - + Q - + W - + W diff --git a/tests/misc/attributes2.html b/tests/misc/attributes2.html index 5971cc8..b78fee0 100644 --- a/tests/misc/attributes2.html +++ b/tests/misc/attributes2.html @@ -1,6 +1,6 @@ -

+

Or in the middle of the text

-

\ No newline at end of file +

\ No newline at end of file diff --git a/tests/misc/blank-block-quote.html b/tests/misc/blank-block-quote.html index 23df17a..966078c 100644 --- a/tests/misc/blank-block-quote.html +++ b/tests/misc/blank-block-quote.html @@ -1,3 +1,3 @@

aaaaaaaaaaa

-
+

bbbbbbbbbbb

\ No newline at end of file diff --git a/tests/test_apis.py b/tests/test_apis.py index eecfbf6..0de897a 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -277,7 +277,7 @@ class testETreeComments(unittest.TestCase): Test that ElementTree Comments work. These tests should only be a concern when using cElementTree with third - party serializers (including markdown's html4 serializer). While markdown + party serializers (including markdown's (x)html serializer). While markdown doesn't use ElementTree.Comment itself, we should certainly support any third party extensions which may. Therefore, these tests are included to ensure such support is maintained. @@ -301,14 +301,14 @@ class testETreeComments(unittest.TestCase): def testCommentSerialization(self): """ Test that an ElementTree Comment serializes properly. """ - self.assertEqual(markdown.html4.to_html_string(self.comment), + self.assertEqual(markdown.searializers.to_html_string(self.comment), '') def testCommentPrettify(self): """ Test that an ElementTree Comment is prettified properly. """ pretty = markdown.treeprocessors.PrettifyTreeprocessor() pretty.run(self.comment) - self.assertEqual(markdown.html4.to_html_string(self.comment), + self.assertEqual(markdown.searializers.to_html_string(self.comment), '\n') @@ -325,7 +325,7 @@ class testAtomicString(unittest.TestCase): p = markdown.util.etree.SubElement(tree, 'p') p.text = u'some *text*' new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.html4.to_html_string(new), + self.assertEqual(markdown.searializers.to_html_string(new), '

some text

') def testSimpleAtomicString(self): @@ -334,7 +334,7 @@ class testAtomicString(unittest.TestCase): p = markdown.util.etree.SubElement(tree, 'p') p.text = markdown.util.AtomicString(u'some *text*') new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.html4.to_html_string(new), + self.assertEqual(markdown.searializers.to_html_string(new), '

some *text*

') def testNestedAtomicString(self): @@ -352,6 +352,6 @@ class testAtomicString(unittest.TestCase): span2.tail = markdown.util.AtomicString(u' *test*') span1.tail = markdown.util.AtomicString(u' *with*') new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.html4.to_html_string(new), + self.assertEqual(markdown.searializers.to_html_string(new), '

*some* *more* *text* *here* *to* *test* *with*

') -- cgit v1.2.3