Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/change_log/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Python-Markdown Change Log

Under development: version 3.3.4 (a bug-fix release).

* Properly parse processing instructions in md_in_html (#1070).
* Properly parse code spans in md_in_html (#1069).

Oct 25, 2020: version 3.3.3 (a bug-fix release).
Expand Down
5 changes: 1 addition & 4 deletions markdown/extensions/md_in_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ def handle_empty_tag(self, data, is_block):
if self.at_line_start() and is_block:
self.handle_data('\n' + self.md.htmlStash.store(data) + '\n\n')
else:
if self.mdstate and self.mdstate[-1] == "off":
self.handle_data(self.md.htmlStash.store(data))
else:
self.handle_data(data)
self.handle_data(self.md.htmlStash.store(data))


class HtmlBlockPreprocessor(Preprocessor):
Expand Down
50 changes: 50 additions & 0 deletions tests/test_syntax/extensions/test_md_in_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,56 @@ def test_md1_in_tail(self):
)
)

def test_md1_PI_oneliner(self):
self.assertMarkdownRenders(
'<div markdown="1"><?php print("foo"); ?></div>',
self.dedent(
"""
<div>
<?php print("foo"); ?>
</div>
"""
)
)

def test_md1_PI_multiline(self):
self.assertMarkdownRenders(
self.dedent(
"""
<div markdown="1">
<?php print("foo"); ?>
</div>
"""
),
self.dedent(
"""
<div>
<?php print("foo"); ?>
</div>
"""
)
)

def test_md1_PI_blank_lines(self):
self.assertMarkdownRenders(
self.dedent(
"""
<div markdown="1">

<?php print("foo"); ?>

</div>
"""
),
self.dedent(
"""
<div>
<?php print("foo"); ?>
</div>
"""
)
)

def test_md_span_paragraph(self):
self.assertMarkdownRenders(
'<p markdown="span">*foo*</p>',
Expand Down