aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorYuri Takhteyev <yuri@freewisdom.org>2007-03-25 04:18:01 +0000
committerYuri Takhteyev <yuri@freewisdom.org>2007-03-25 04:18:01 +0000
commitcd9708990aa7dae660820f58221e4507241314e9 (patch)
treee42d347569a470ef803648871aa6f927aa91f5b2 /markdown.py
parent0a1c1b5aeb62afa21bd676cfba6cf88821f1176f (diff)
downloadmarkdown-cd9708990aa7dae660820f58221e4507241314e9.tar.gz
markdown-cd9708990aa7dae660820f58221e4507241314e9.tar.bz2
markdown-cd9708990aa7dae660820f58221e4507241314e9.zip
Handle unbalanced block-level tags.
Diffstat (limited to 'markdown.py')
-rw-r--r--markdown.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/markdown.py b/markdown.py
index dee572e..37b9b13 100644
--- a/markdown.py
+++ b/markdown.py
@@ -566,7 +566,11 @@ class HtmlBlockPreprocessor (Preprocessor):
new_blocks.append(
self.stash.store('\n\n'.join(items)))
items = []
-
+
+ if items :
+ new_blocks.append(self.stash.store('\n\n'.join(items)))
+ new_blocks.append('\n')
+
return "\n\n".join(new_blocks).split("\n")
HTML_BLOCK_PREPROCESSOR = HtmlBlockPreprocessor()
@@ -1599,6 +1603,9 @@ class Markdown:
if source :
self.source = source
+ if not self.source :
+ return ""
+
self.source = removeBOM(self.source, self.encoding)