From 83ae589dfbf7e8331642fe0d6951655825eff56d Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 8 Oct 2007 01:57:40 +0000 Subject: fixed whitespace handling to match 1.6b - a codeblock on the first line now works. --- markdown.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'markdown.py') diff --git a/markdown.py b/markdown.py index e1e7dae..cb90171 100644 --- a/markdown.py +++ b/markdown.py @@ -1180,7 +1180,7 @@ class Markdown: self.doc.appendChild(self.top_element) # Fixup the source text - text = self.source.strip() + text = self.source text = text.replace("\r\n", "\n").replace("\r", "\n") text += "\n\n" text = text.expandtabs(TAB_LENGTH) @@ -1658,7 +1658,7 @@ class Markdown: for pp in self.textPostprocessors : xml = pp.run(xml) - return self.docType + xml + return (self.docType + xml).strip() __str__ = convert # deprecated - will be changed in 1.7 to report -- cgit v1.2.3