From b688bf59dee2ed1552c0b232a43066ba18393ab0 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sun, 23 Aug 2009 14:42:52 -0400 Subject: Fixed Ticket 43. Apparenlty ElementTree does not recognize 'utf8' as an alias of 'utf-8' and outputs invalid xml. We never noticed as stripTopLevelTags removes the offending fragment. However, there are legitimate uses for turning off stripTopLevelTags. Therefore, from now on we will be using 'utf-8' internally. Thanks to Mark Eichin for the report. --- markdown/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'markdown') diff --git a/markdown/__init__.py b/markdown/__init__.py index 086fde9..6010715 100644 --- a/markdown/__init__.py +++ b/markdown/__init__.py @@ -395,7 +395,7 @@ class Markdown: root = newRoot # Serialize _properly_. Strip top-level tags. - output, length = codecs.utf_8_decode(self.serializer(root, encoding="utf8")) + output, length = codecs.utf_8_decode(self.serializer(root, encoding="utf-8")) if self.stripTopLevelTags: try: start = output.index('<%s>'%DOC_TAG)+len(DOC_TAG)+2 -- cgit v1.2.3