diff --git a/docs/change_log/index.md b/docs/change_log/index.md index bce97da94..7edb2b9a6 100644 --- a/docs/change_log/index.md +++ b/docs/change_log/index.md @@ -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). diff --git a/markdown/extensions/md_in_html.py b/markdown/extensions/md_in_html.py index b8848efdd..6d2a0e78d 100644 --- a/markdown/extensions/md_in_html.py +++ b/markdown/extensions/md_in_html.py @@ -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): diff --git a/tests/test_syntax/extensions/test_md_in_html.py b/tests/test_syntax/extensions/test_md_in_html.py index 7786b80e5..865560709 100644 --- a/tests/test_syntax/extensions/test_md_in_html.py +++ b/tests/test_syntax/extensions/test_md_in_html.py @@ -634,6 +634,56 @@ def test_md1_in_tail(self): ) ) + def test_md1_PI_oneliner(self): + self.assertMarkdownRenders( + '
', + self.dedent( + """ +*foo*
',