aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/__init__.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2013-02-06 16:05:52 -0500
committerWaylan Limberg <waylan@gmail.com>2013-02-06 16:05:52 -0500
commitd5a94c21313915ebbd50c061bf19e68ef6dee115 (patch)
tree0bf1cd8c1c68b42458a225418efc157132d021a2 /markdown/__init__.py
parent4ff74e33a48a8c4e101d2f5e259d7b911c03d9f9 (diff)
downloadmarkdown-d5a94c21313915ebbd50c061bf19e68ef6dee115.tar.gz
markdown-d5a94c21313915ebbd50c061bf19e68ef6dee115.tar.bz2
markdown-d5a94c21313915ebbd50c061bf19e68ef6dee115.zip
Preserve empty lines in code blocks
Partial fix for #183. Some lines are still being lost. When the processors are run, one line is lost. When their calling code is comments out (completely skiped) a line is still lost if more than 3 exist in a row. Also need to add some tests for this.
Diffstat (limited to 'markdown/__init__.py')
-rw-r--r--markdown/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 959f387..fbd2879 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -283,8 +283,8 @@ class Markdown:
source = source.replace(util.STX, "").replace(util.ETX, "")
source = source.replace("\r\n", "\n").replace("\r", "\n") + "\n\n"
- source = re.sub(r'\n\s+\n', '\n\n', source)
source = source.expandtabs(self.tab_length)
+ source = re.sub(r'\n +\n', '\n\n', source)
# Split into lines and run the line preprocessors.
self.lines = source.split("\n")