diff options
author | Waylan Limberg <waylan@gmail.com> | 2013-02-06 16:05:52 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2013-02-06 16:05:52 -0500 |
commit | d5a94c21313915ebbd50c061bf19e68ef6dee115 (patch) | |
tree | 0bf1cd8c1c68b42458a225418efc157132d021a2 /markdown/__init__.py | |
parent | 4ff74e33a48a8c4e101d2f5e259d7b911c03d9f9 (diff) | |
download | markdown-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__.py | 2 |
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") |