aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/preprocessors.py9
-rw-r--r--tests/misc/multi-line-tags.html10
-rw-r--r--tests/misc/multi-line-tags.txt7
-rw-r--r--tests/misc/multiline-comments.html2
4 files changed, 25 insertions, 3 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py
index 28f731f..a80f9fb 100644
--- a/markdown/preprocessors.py
+++ b/markdown/preprocessors.py
@@ -202,14 +202,21 @@ class HtmlBlockPreprocessor(Preprocessor):
new_blocks.append(block)
else:
+ #import pdb; pdb.set_trace()
items.append(block)
right_tag, data_index = self._get_right_tag(left_tag,
- left_index,
+ 0,
block)
if self._equal_tags(left_tag, right_tag):
# if find closing tag
+
+ if data_index < len(block):
+ # we have more text after right_tag
+ items[-1] = block[:data_index]
+ text.insert(0, block[data_index:])
+
in_tag = False
if self.markdown_in_raw and 'markdown' in attrs.keys():
start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?',
diff --git a/tests/misc/multi-line-tags.html b/tests/misc/multi-line-tags.html
index 784c1dd..69899aa 100644
--- a/tests/misc/multi-line-tags.html
+++ b/tests/misc/multi-line-tags.html
@@ -2,4 +2,12 @@
asdf asdfasd
-</div> \ No newline at end of file
+</div>
+
+<div>
+
+foo bar
+
+</div>
+
+<p>No blank line.</p> \ No newline at end of file
diff --git a/tests/misc/multi-line-tags.txt b/tests/misc/multi-line-tags.txt
index 4ea3b02..9056473 100644
--- a/tests/misc/multi-line-tags.txt
+++ b/tests/misc/multi-line-tags.txt
@@ -4,3 +4,10 @@
asdf asdfasd
</div>
+
+<div>
+
+foo bar
+
+</div>
+No blank line.
diff --git a/tests/misc/multiline-comments.html b/tests/misc/multiline-comments.html
index 12f8cb5..29c17e9 100644
--- a/tests/misc/multiline-comments.html
+++ b/tests/misc/multiline-comments.html
@@ -2,7 +2,7 @@
foo
--->
+-->
<p>