aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/preprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2013-02-07 11:43:46 -0500
committerWaylan Limberg <waylan@gmail.com>2013-02-07 11:43:46 -0500
commit25e187598f06f04feeacbf967b7651e93286d3f4 (patch)
treea9467c4618b3e173835aa08e2c8896208f281744 /markdown/preprocessors.py
parent0a65037e120e0e14659991379648a1a4345b6981 (diff)
downloadmarkdown-25e187598f06f04feeacbf967b7651e93286d3f4.tar.gz
markdown-25e187598f06f04feeacbf967b7651e93286d3f4.tar.bz2
markdown-25e187598f06f04feeacbf967b7651e93286d3f4.zip
HtmlBlockProcessor preserves empty lines
Partial fix for #183. This has the same effect on empty lines in code blocks as not using the html processor at all (which was eating some of the missing newlines as reported in issue #183). By doing `rsplit('\n\n')` the third newline (in each set of three) always ends up at the end of a block, rather than the begining - which it less of an issue for the html processor. Also updated tests to indicate final intended output, although they do not fully pass yet.
Diffstat (limited to 'markdown/preprocessors.py')
-rw-r--r--markdown/preprocessors.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py
index e7743fb..e968580 100644
--- a/markdown/preprocessors.py
+++ b/markdown/preprocessors.py
@@ -127,7 +127,7 @@ class HtmlBlockPreprocessor(Preprocessor):
def run(self, lines):
text = "\n".join(lines)
new_blocks = []
- text = text.split("\n\n")
+ text = text.rsplit("\n\n")
items = []
left_tag = ''
right_tag = ''