File tree 2 files changed +43
-2
lines changed
tests/test_syntax/extensions
2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -265,8 +265,7 @@ def handle_data(self, data):
265
265
if self .inraw or not self .mdstack :
266
266
super ().handle_data (data )
267
267
else :
268
- for i in range (len (self .mdstarted )):
269
- self .mdstarted [i ] = False
268
+ self .mdstarted [- 1 ] = False
270
269
self .treebuilder .data (data )
271
270
272
271
def handle_empty_tag (self , data , is_block ):
Original file line number Diff line number Diff line change @@ -1314,6 +1314,48 @@ def test_md1_oneliner_block_mixed(self):
1314
1314
extensions = ['md_in_html' ]
1315
1315
)
1316
1316
1317
+ def test_md1_oneliner_block_tail (self ):
1318
+ # https://github.com/Python-Markdown/markdown/issues/1074
1319
+ self .assertMarkdownRenders (
1320
+ self .dedent (
1321
+ """
1322
+ <div class="a" markdown="block"><div class="b" markdown="block">
1323
+ **foo**
1324
+ </div><div class="c" markdown="block"><div class="d" markdown="block">
1325
+ *bar*
1326
+ </div></div></div>
1327
+ """
1328
+ ),
1329
+ '<div class="a">\n '
1330
+ '<div class="b">\n '
1331
+ '<p><strong>foo</strong></p>\n '
1332
+ '</div>\n '
1333
+ '<div class="c">\n '
1334
+ '<div class="d">\n '
1335
+ '<p><em>bar</em></p>\n '
1336
+ '</div>\n '
1337
+ '</div>\n '
1338
+ '</div>' ,
1339
+ extensions = ['md_in_html' ]
1340
+ )
1341
+
1342
+ def test_md1_oneliner_block_complex_start_tail (self ):
1343
+ # https://github.com/Python-Markdown/markdown/issues/1074
1344
+ self .assertMarkdownRenders (
1345
+ '<div class="a" markdown><div class="b" markdown>**foo**</div>'
1346
+ '<div class="c" markdown>*bar*</div><div class="d">*not md*</div></div>' ,
1347
+ '<div class="a">\n '
1348
+ '<div class="b">\n '
1349
+ '<p><strong>foo</strong></p>\n '
1350
+ '</div>\n '
1351
+ '<div class="c">\n '
1352
+ '<p><em>bar</em></p>\n '
1353
+ '</div>\n '
1354
+ '<div class="d">*not md*</div>\n '
1355
+ '</div>' ,
1356
+ extensions = ['md_in_html' ]
1357
+ )
1358
+
1317
1359
def test_md1_oneliner_block_start (self ):
1318
1360
# https://github.com/Python-Markdown/markdown/issues/1074
1319
1361
self .assertMarkdownRenders (
You can’t perform that action at this time.
0 commit comments