@@ -160,7 +160,7 @@ def test_section_with_code_snippet(self):
160160 extensions = self .MARKDOWN_EXTENSIONS ,
161161 output_format = 'html5'
162162 )
163- expected_output = '<p>some Android content shown</p>\n <p><code>java\n String java = "asdf";</code>\n </p>'
163+ expected_output = '<p>some Android content shown</p>\n <p><code>java\n String java = "asdf";</code></p>'
164164 self .assertEqual (expected_output , html )
165165
166166 def test_multiple_sections_with_code_snippet (self ):
@@ -181,7 +181,7 @@ def test_multiple_sections_with_code_snippet(self):
181181 extensions = self .MARKDOWN_EXTENSIONS ,
182182 output_format = 'html5'
183183 )
184- expected_output = '<p>some Android content shown</p>\n <p><code>java\n String java = "asdf";</code>\n </p>'
184+ expected_output = '<p>some Android content shown</p>\n <p><code>java\n String java = "asdf";</code></p>'
185185 self .assertEqual (expected_output , html )
186186
187187 def test_inline_platform_section (self ):
@@ -307,3 +307,25 @@ def test_back_to_back_platform_section_tags(self):
307307 )
308308 expected_output = '<p>Back to back Android tags!</p>'
309309 self .assertEqual (expected_output , html )
310+
311+ def test_tag_end_paragraph_start_header (self ):
312+ text = 'You need to implement this. @![ios]In iOS, also this.!@\n \n ## Next Header\n The header above should be rendered.\n '
313+
314+ html = markdown .markdown (
315+ text ,
316+ extension_configs = self .build_config_for_platform_section ('iOS' ),
317+ extensions = ['markdown.extensions.tables' ] + self .MARKDOWN_EXTENSIONS ,
318+ output_format = 'html5'
319+ )
320+
321+ expected_output = '<p>You need to implement this. In iOS, also this.</p>\n <h2>Next Header</h2>\n <p>The header above should be rendered.</p>'
322+ self .assertEqual (expected_output , html )
323+
324+ html = markdown .markdown (
325+ text ,
326+ extension_configs = self .build_config_for_platform_section ('Android' ),
327+ extensions = ['markdown.extensions.tables' ] + self .MARKDOWN_EXTENSIONS ,
328+ output_format = 'html5'
329+ )
330+ expected_output = '<p>You need to implement this. </p>\n <h2>Next Header</h2>\n <p>The header above should be rendered.</p>'
331+ self .assertEqual (expected_output , html )
0 commit comments