aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmarkdown.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/markdown.py b/markdown.py
index dec3e86..6645b27 100755
--- a/markdown.py
+++ b/markdown.py
@@ -1927,11 +1927,7 @@ class Markdown:
Returns: ElementTree object.
"""
- if source is not None: #Allow blank string
- self.source = source
-
- if not self.source:
- return u""
+
try:
self.source = unicode(self.source)
@@ -1966,6 +1962,12 @@ class Markdown:
Returns: A serialized XHTML body.
"""
+
+ if source is not None: #Allow blank string
+ self.source = source
+
+ if not self.source:
+ return u""
tree = self.markdownToTree(source)