diff options
-rw-r--r-- | markdown/preprocessors.py | 2 | ||||
-rw-r--r-- | tests/misc/raw_whitespace.html | 8 | ||||
-rw-r--r-- | tests/misc/raw_whitespace.txt | 10 |
3 files changed, 19 insertions, 1 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py index ef04cab..5342d44 100644 --- a/markdown/preprocessors.py +++ b/markdown/preprocessors.py @@ -169,7 +169,7 @@ class HtmlBlockPreprocessor(Preprocessor): new_blocks.append(block) else: - items.append(block.strip()) + items.append(block) right_tag, data_index = self._get_right_tag(left_tag, block) diff --git a/tests/misc/raw_whitespace.html b/tests/misc/raw_whitespace.html new file mode 100644 index 0000000..7a6f131 --- /dev/null +++ b/tests/misc/raw_whitespace.html @@ -0,0 +1,8 @@ +<p>Preserve whitespace in raw html</p> +<pre> +class Foo(): + bar = 'bar' + + def baz(self): + print self.bar +</pre>
\ No newline at end of file diff --git a/tests/misc/raw_whitespace.txt b/tests/misc/raw_whitespace.txt new file mode 100644 index 0000000..bbc7cec --- /dev/null +++ b/tests/misc/raw_whitespace.txt @@ -0,0 +1,10 @@ +Preserve whitespace in raw html + +<pre> +class Foo(): + bar = 'bar' + + def baz(self): + print self.bar +</pre> + |