@@ -1206,6 +1206,115 @@ def test_md1_nested_footnote_ref(self):
1206
1206
extensions = ['md_in_html' , 'footnotes' ]
1207
1207
)
1208
1208
1209
+ def test_md1_code_void_tag (self ):
1210
+
1211
+ # https://github.com/Python-Markdown/markdown/issues/1075
1212
+ self .assertMarkdownRenders (
1213
+ self .dedent (
1214
+ """
1215
+ <div class="outer" markdown="1">
1216
+
1217
+ Code: `<label></input></label>`
1218
+
1219
+ </div>
1220
+
1221
+ <div class="outer" markdown="1">
1222
+
1223
+ HTML: <label></input></label>
1224
+
1225
+ </div>
1226
+ """
1227
+ ),
1228
+ '<div class="outer">\n '
1229
+ '<p>Code: <code><label></input></label></code></p>\n '
1230
+ '</div>\n '
1231
+ '<div class="outer">\n '
1232
+ '<p>HTML: <label></input></label></p>\n '
1233
+ '</div>' ,
1234
+ extensions = ['md_in_html' ]
1235
+ )
1236
+
1237
+ def test_md1_code_comment (self ):
1238
+
1239
+ self .assertMarkdownRenders (
1240
+ self .dedent (
1241
+ """
1242
+ <div class="outer" markdown="1">
1243
+
1244
+ Code: `<label><!-- **comment** --></label>`
1245
+
1246
+ </div>
1247
+
1248
+ <div class="outer" markdown="1">
1249
+
1250
+ HTML: <label><!-- **comment** --></label>
1251
+
1252
+ </div>
1253
+ """
1254
+ ),
1255
+ '<div class="outer">\n '
1256
+ '<p>Code: <code><label><!-- **comment** --></label></code></p>\n '
1257
+ '</div>\n '
1258
+ '<div class="outer">\n '
1259
+ '<p>HTML: <label><!-- **comment** --></label></p>\n '
1260
+ '</div>' ,
1261
+ extensions = ['md_in_html' ]
1262
+ )
1263
+
1264
+ def test_md1_code_pi (self ):
1265
+
1266
+ self .assertMarkdownRenders (
1267
+ self .dedent (
1268
+ """
1269
+ <div class="outer" markdown="1">
1270
+
1271
+ Code: `<label><?php # echo '**simple**';?></label>`
1272
+
1273
+ </div>
1274
+
1275
+ <div class="outer" markdown="1">
1276
+
1277
+ HTML: <label><?php # echo '**simple**';?></label>
1278
+
1279
+ </div>
1280
+ """
1281
+ ),
1282
+ '<div class="outer">\n '
1283
+ '<p>Code: <code><label><?php # echo \' **simple**\' ;?></label></code></p>\n '
1284
+ '</div>\n '
1285
+ '<div class="outer">\n '
1286
+ '<p>HTML: <label><?php # echo \' **simple**\' ;?></label></p>\n '
1287
+ '</div>' ,
1288
+ extensions = ['md_in_html' ]
1289
+ )
1290
+
1291
+ def test_md1_code_cdata (self ):
1292
+
1293
+ self .assertMarkdownRenders (
1294
+ self .dedent (
1295
+ """
1296
+ <div class="outer" markdown="1">
1297
+
1298
+ Code: `<label><![CDATA[some stuff]]></label>`
1299
+
1300
+ </div>
1301
+
1302
+ <div class="outer" markdown="1">
1303
+
1304
+ HTML: <label><![CDATA[some stuff]]></label>
1305
+
1306
+ </div>
1307
+ """
1308
+ ),
1309
+ '<div class="outer">\n '
1310
+ '<p>Code: <code><label><![CDATA[some stuff]]></label></code></p>\n '
1311
+ '</div>\n '
1312
+ '<div class="outer">\n '
1313
+ '<p>HTML: <label><![CDATA[some stuff]]></label></p>\n '
1314
+ '</div>' ,
1315
+ extensions = ['md_in_html' ]
1316
+ )
1317
+
1209
1318
1210
1319
def load_tests (loader , tests , pattern ):
1211
1320
""" Ensure `TestHTMLBlocks` doesn't get run twice by excluding it here. """
0 commit comments