Commit 20cb74457b7e858965f20dcab7a475dd061ef0cf

Martin Mitas 2024-01-16T15:10:57

Merge branch 'test_opts'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 53ce7fd..471e87b 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -31,49 +31,53 @@ echo "CommonMark specification:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/spec.txt" -p "$PROGRAM"
 
 echo
-echo "Code coverage & regressions:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/coverage.txt" -p "$PROGRAM"
-
-echo
 echo "Permissive e-mail autolinks extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-email-autolinks.txt" -p "$PROGRAM --fpermissive-email-autolinks"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-email-autolinks.txt" -p "$PROGRAM"
 
 echo
 echo "Permissive URL autolinks extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-url-autolinks.txt" -p "$PROGRAM --fpermissive-url-autolinks"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-url-autolinks.txt" -p "$PROGRAM"
 
 echo
 echo "WWW autolinks extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-www-autolinks.txt" -p "$PROGRAM --fpermissive-www-autolinks"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-www-autolinks.txt" -p "$PROGRAM"
 
 echo
 echo "Hard soft breaks extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/hard-soft-breaks.txt" -p "$PROGRAM --fhard-soft-breaks"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/hard-soft-breaks.txt" -p "$PROGRAM"
 
 echo
 echo "Tables extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tables.txt" -p "$PROGRAM --ftables"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tables.txt" -p "$PROGRAM"
 
 echo
 echo "Strikethrough extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/strikethrough.txt" -p "$PROGRAM --fstrikethrough"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/strikethrough.txt" -p "$PROGRAM"
 
 echo
 echo "Task lists extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tasklists.txt" -p "$PROGRAM --ftasklists"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tasklists.txt" -p "$PROGRAM"
 
 echo
 echo "LaTeX extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/latex-math.txt" -p "$PROGRAM --flatex-math"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/latex-math.txt" -p "$PROGRAM"
 
 echo
 echo "Wiki links extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/wiki-links.txt" -p "$PROGRAM --fwiki-links --ftables"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/wiki-links.txt" -p "$PROGRAM"
 
 echo
 echo "Underline extension:"
-$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/underline.txt" -p "$PROGRAM --funderline"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/underline.txt" -p "$PROGRAM"
+
+echo
+echo "Code coverage:"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/coverage.txt" -p "$PROGRAM"
+
+echo
+echo "Regressions:"
+$PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/regressions.txt" -p "$PROGRAM"
 
 echo
-echo "Pathological input:"
+echo "Pathological inputs:"
 $PYTHON "$TEST_DIR/pathological_tests.py" -p "$PROGRAM"
diff --git a/test/cmark.py b/test/cmark.py
deleted file mode 100755
index 1110860..0000000
--- a/test/cmark.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from ctypes import CDLL, c_char_p, c_long
-from subprocess import *
-import platform
-import os
-
-def pipe_through_prog(prog, text):
-    p1 = Popen(prog.split(), stdout=PIPE, stdin=PIPE, stderr=PIPE)
-    [result, err] = p1.communicate(input=text.encode('utf-8'))
-    return [p1.returncode, result.decode('utf-8'), err]
-
-def use_library(lib, text):
-    textbytes = text.encode('utf-8')
-    textlen = len(textbytes)
-    return [0, lib(textbytes, textlen, 0).decode('utf-8'), '']
-
-class CMark:
-    def __init__(self, prog=None, library_dir=None):
-        self.prog = prog
-        if prog:
-            self.to_html = lambda x: pipe_through_prog(prog, x)
-        else:
-            sysname = platform.system()
-            if sysname == 'Darwin':
-                libname = "libcmark.dylib"
-            elif sysname == 'Windows':
-                libname = "cmark.dll"
-            else:
-                libname = "libcmark.so"
-            if library_dir:
-                libpath = os.path.join(library_dir, libname)
-            else:
-                libpath = os.path.join("build", "src", libname)
-            cmark = CDLL(libpath)
-            markdown = cmark.cmark_markdown_to_html
-            markdown.restype = c_char_p
-            markdown.argtypes = [c_char_p, c_long]
-            self.to_html = lambda x: use_library(markdown, x)
diff --git a/test/coverage.txt b/test/coverage.txt
index 5d79bdb..e8954c3 100644
--- a/test/coverage.txt
+++ b/test/coverage.txt
@@ -1,458 +1,11 @@
 
 # Coverage
 
-This file is just a collection of unit tests not covered elsewhere.
+This file is just a collection of tests designed to activate code in MD4C
+which may otherwise be hard to hit. It's to improve our test coverage.
 
-Most notably regression tests, tests improving code coverage and other useful
-things may drop here.
 
-(However any tests requiring any additional command line option, like enabling
-an extension, must be included in their respective files.)
-
-
-## GitHub Issues
-
-### [Issue 2](https://github.com/mity/md4c/issues/2)
-
-Raw HTML block:
-
-```````````````````````````````` example
-<gi att1=tok1 att2=tok2>
-.
-<gi att1=tok1 att2=tok2>
-````````````````````````````````
-
-Inline:
-
-```````````````````````````````` example
-foo <gi att1=tok1 att2=tok2> bar
-.
-<p>foo <gi att1=tok1 att2=tok2> bar</p>
-````````````````````````````````
-
-Inline with a line break:
-
-```````````````````````````````` example
-foo <gi att1=tok1
-att2=tok2> bar
-.
-<p>foo <gi att1=tok1
-att2=tok2> bar</p>
-````````````````````````````````
-
-
-### [Issue 4](https://github.com/mity/md4c/issues/4)
-
-```````````````````````````````` example
-![alt text with *entity* &copy;](img.png 'title')
-.
-<p><img src="img.png" alt="alt text with entity ©" title="title"></p>
-````````````````````````````````
-
-
-### [Issue 9](https://github.com/mity/md4c/issues/9)
-
-```````````````````````````````` example
-> [foo
-> bar]: /url
->
-> [foo bar]
-.
-<blockquote>
-<p><a href="/url">foo
-bar</a></p>
-</blockquote>
-````````````````````````````````
-
-
-### [Issue 10](https://github.com/mity/md4c/issues/10)
-
-```````````````````````````````` example
-[x]:
-x
-- <?
-
-  x
-.
-<ul>
-<li><?
-
-x
-</li>
-</ul>
-````````````````````````````````
-
-
-### [Issue 11](https://github.com/mity/md4c/issues/11)
-
-```````````````````````````````` example
-x [link](/url "foo &ndash; bar") x
-.
-<p>x <a href="/url" title="foo – bar">link</a> x</p>
-````````````````````````````````
-
-
-### [Issue 14](https://github.com/mity/md4c/issues/14)
-
-```````````````````````````````` example
-a***b* c*
-.
-<p>a*<em><em>b</em> c</em></p>
-````````````````````````````````
-
-
-### [Issue 15](https://github.com/mity/md4c/issues/15)
-
-```````````````````````````````` example
-***b* c*
-.
-<p>*<em><em>b</em> c</em></p>
-````````````````````````````````
-
-
-### [Issue 21](https://github.com/mity/md4c/issues/21)
-
-```````````````````````````````` example
-a*b**c*
-.
-<p>a<em>b**c</em></p>
-````````````````````````````````
-
-
-### [Issue 33](https://github.com/mity/md4c/issues/33)
-
-```````````````````````````````` example
-```&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;
-.
-<pre><code class="language-&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;"></code></pre>
-````````````````````````````````
-
-
-### [Issue 36](https://github.com/mity/md4c/issues/36)
-
-```````````````````````````````` example
-__x_ _x___
-.
-<p><em><em>x</em> <em>x</em></em>_</p>
-````````````````````````````````
-
-
-### [Issue 39](https://github.com/mity/md4c/issues/39)
-
-```````````````````````````````` example
-[\\]: x
-.
-````````````````````````````````
-
-
-### [Issue 40](https://github.com/mity/md4c/issues/40)
-
-```````````````````````````````` example
-[x](url
-'title'
-)x
-.
-<p><a href="url" title="title">x</a>x</p>
-````````````````````````````````
-
-
-### [Issue 65](https://github.com/mity/md4c/issues/65)
-
-```````````````````````````````` example
-`
-.
-<p>`</p>
-````````````````````````````````
-
-
-### [Issue 74](https://github.com/mity/md4c/issues/74)
-
-```````````````````````````````` example
-[f]:
--
-    xx
--
-.
-<pre><code>xx
-</code></pre>
-<ul>
-<li></li>
-</ul>
-````````````````````````````````
-
-
-### [Issue 78](https://github.com/mity/md4c/issues/78)
-
-```````````````````````````````` example
-[SS ẞ]: /url
-[ẞ SS]
-.
-<p><a href="/url">ẞ SS</a></p>
-````````````````````````````````
-
-
-### [Issue 83](https://github.com/mity/md4c/issues/83)
-
-```````````````````````````````` example
-foo
->
-.
-<p>foo</p>
-<blockquote>
-</blockquote>
-
-````````````````````````````````
-
-
-### [Issue 95](https://github.com/mity/md4c/issues/95)
-
-```````````````````````````````` example
-. foo
-.
-<p>. foo</p>
-````````````````````````````````
-
-
-### [Issue 96](https://github.com/mity/md4c/issues/96)
-
-```````````````````````````````` example
-[ab]: /foo
-[a] [ab] [abc]
-.
-<p>[a] <a href="/foo">ab</a> [abc]</p>
-````````````````````````````````
-
-```````````````````````````````` example
-[a b]: /foo
-[a   b]
-.
-<p><a href="/foo">a   b</a></p>
-````````````````````````````````
-
-
-### [Issue 97](https://github.com/mity/md4c/issues/97)
-
-```````````````````````````````` example
-*a **b c* d**
-.
-<p><em>a <em><em>b c</em> d</em></em></p>
-
-````````````````````````````````
-
-
-### [Issue 100](https://github.com/mity/md4c/issues/100)
-
-```````````````````````````````` example
-<foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123>
-.
-<p><a href="mailto:foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123">foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123</a></p>
-````````````````````````````````
-
-```````````````````````````````` example
-<foo@123456789012345678901234567890123456789012345678901234567890123x.123456789012345678901234567890123456789012345678901234567890123>
-.
-<p>&lt;foo@123456789012345678901234567890123456789012345678901234567890123x.123456789012345678901234567890123456789012345678901234567890123&gt;</p>
-````````````````````````````````
-(Note the `x` here which turns it over the max. allowed length limit.)
-
-
-### [Issue 107](https://github.com/mity/md4c/issues/107)
-
-```````````````````````````````` example
-***foo *bar baz***
-.
-<p>*<strong>foo <em>bar baz</em></strong></p>
-
-````````````````````````````````
-
-
-### [Issue 124](https://github.com/mity/md4c/issues/124)
-
-```````````````````````````````` example
-~~~
-                x
-~~~
-
-~~~
-                 x
-~~~
-.
-<pre><code>                x
-</code></pre>
-<pre><code>                 x
-</code></pre>
-````````````````````````````````
-
-
-### [Issue 131](https://github.com/mity/md4c/issues/131)
-
-```````````````````````````````` example
-[![alt][img]][link]
-
-[img]: img_url
-[link]: link_url
-.
-<p><a href="link_url"><img src="img_url" alt="alt"></a></p>
-````````````````````````````````
-
-
-### [Issue 142](https://github.com/mity/md4c/issues/142)
-
-```````````````````````````````` example
-[fooﬗ]: /url
-[fooﬕ]
-.
-<p>[fooﬕ]</p>
-````````````````````````````````
-
-
-### [Issue 149](https://github.com/mity/md4c/issues/149)
-
-```````````````````````````````` example
-- <script>
-- foo
-bar
-</script>
-.
-<ul>
-<li><script>
-</li>
-<li>foo
-bar
-</script></li>
-</ul>
-````````````````````````````````
-
-
-### [Issue 190](https://github.com/mity/md4c/issues/190)
-
-```````````````````````````````` example
--
-
-    foo
-.
-<ul>
-<li></li>
-</ul>
-<pre><code>foo
-</code></pre>
-````````````````````````````````
-
-
-### [Issue 200](https://github.com/mity/md4c/issues/200)
-
-```````````````````````````````` example
-<!-- foo -->
-    ```
-    bar
-    ```
-.
-<!-- foo -->
-<pre><code>```
-bar
-```
-</code></pre>
-````````````````````````````````
-
-
-### [Issue 201](https://github.com/mity/md4c/issues/201)
-
-```````````````````````````````` example
-foo
-    ```
-    bar
-    ```
-.
-<p>foo
-<code>bar</code></p>
-````````````````````````````````
-
-
-### [Issue 207](https://github.com/mity/md4c/issues/207)
-
-```````````````````````````````` example
-<textarea>
-
-*foo*
-
-_bar_
-
-</textarea>
-
-baz
-.
-<textarea>
-
-*foo*
-
-_bar_
-
-</textarea>
-<p>baz</p>
-````````````````````````````````
-
-
-### [Issue 210](https://github.com/mity/md4c/issues/210)
-
-```````````````````````````````` example
-![outer ![inner](img_inner "inner title")](img_outer "outer title")
-.
-<p><img src="img_outer" alt="outer inner" title="outer title"></p>
-````````````````````````````````
-
-
-### [Issue 215](https://github.com/mity/md4c/issues/215)
-
-```````````````````````````````` example
-title
---→
-.
-<h2>title</h2>
-````````````````````````````````
-
-
-### [Issue 216](https://github.com/mity/md4c/issues/216)
-
-```````````````````````````````` example
-x <!A>
-.
-<p>x <!A></p>
-````````````````````````````````
-
-
-### [Issue 217](https://github.com/mity/md4c/issues/217)
-
-```````````````````````````````` example
-__!_!__
-
-__!x!__
-
-**!*!**
-
----
-
-_*__*_*
-
-_*xx*_*
-
-_*__-_-
-
-_*xx-_-
-.
-<p><strong>!_!</strong></p>
-<p><strong>!x!</strong></p>
-<p><strong>!*!</strong></p>
-<hr />
-<p><em><em>__</em></em>*</p>
-<p><em><em>xx</em></em>*</p>
-<p><em>*__-</em>-</p>
-<p><em>*xx-</em>-</p>
-````````````````````````````````
-
-
-## Code coverage
-
-### `md_is_unicode_whitespace__()`
+## `md_is_unicode_whitespace__()`
 
 Unicode whitespace (here U+2000) forms a word boundary so these cannot be
 resolved as emphasis span because there is no closer mark.
@@ -464,7 +17,7 @@ resolved as emphasis span because there is no closer mark.
 ````````````````````````````````
 
 
-### `md_is_unicode_punct__()`
+## `md_is_unicode_punct__()`
 
 Ditto for Unicode punctuation (here U+00A1).
 
@@ -475,7 +28,7 @@ Ditto for Unicode punctuation (here U+00A1).
 ````````````````````````````````
 
 
-### `md_get_unicode_fold_info()`
+## `md_get_unicode_fold_info()`
 
 ```````````````````````````````` example
 [Příliš žluťoučký kůň úpěl ďábelské ódy.]
@@ -486,7 +39,7 @@ Ditto for Unicode punctuation (here U+00A1).
 ````````````````````````````````
 
 
-### `md_decode_utf8__()` and `md_decode_utf8_before__()`
+## `md_decode_utf8__()` and `md_decode_utf8_before__()`
 
 ```````````````````````````````` example
 á*Á (U+00E1, i.e. two byte UTF-8 sequence)
@@ -497,7 +50,7 @@ Ditto for Unicode punctuation (here U+00A1).
 ````````````````````````````````
 
 
-### `md_is_link_destination_A()`
+## `md_is_link_destination_A()`
 
 ```````````````````````````````` example
 [link](</url\.with\.escape>)
@@ -506,7 +59,7 @@ Ditto for Unicode punctuation (here U+00A1).
 ````````````````````````````````
 
 
-### `md_link_label_eq()`
+## `md_link_label_eq()`
 
 ```````````````````````````````` example
 [foo bar]
@@ -517,7 +70,7 @@ Ditto for Unicode punctuation (here U+00A1).
 ````````````````````````````````
 
 
-### `md_is_inline_link_spec()`
+## `md_is_inline_link_spec()`
 
 ```````````````````````````````` example
 > [link](/url 'foo
@@ -530,7 +83,7 @@ bar">link</a></p>
 ````````````````````````````````
 
 
-### `md_build_ref_def_hashtable()`
+## `md_build_ref_def_hashtable()`
 
 All link labels in the following example all have the same FNV1a hash (after
 normalization of the label, which means after converting to a vector of Unicode
diff --git a/test/hard-soft-breaks.txt b/test/hard-soft-breaks.txt
index 45cb383..b33f6c7 100644
--- a/test/hard-soft-breaks.txt
+++ b/test/hard-soft-breaks.txt
@@ -10,6 +10,8 @@ baz
 .
 <p>foo<br>
 baz</p>
+.
+--fhard-soft-breaks
 ````````````````````````````````
 
 ```````````````````````````````` example
@@ -21,4 +23,6 @@ render soft line breaks as hard line breaks.
 <p>A quote from the CommonMark Spec below:</p>
 <p>A renderer may also provide an option to<br>
 render soft line breaks as hard line breaks.</p>
+.
+--fhard-soft-breaks
 ````````````````````````````````
diff --git a/test/latex-math.txt b/test/latex-math.txt
index 2a5774c..1f44fea 100644
--- a/test/latex-math.txt
+++ b/test/latex-math.txt
@@ -11,6 +11,8 @@ A math span is is any text wrapped in dollars or double dollars (`$...$` or
 $a+b=c$ Hello, world!
 .
 <p><x-equation>a+b=c</x-equation> Hello, world!</p>
+.
+--flatex-math
 ````````````````````````````````
 
 If the double dollar sign is used, the math span is a display math span.
@@ -19,6 +21,8 @@ If the double dollar sign is used, the math span is a display math span.
 This is a display equation: $$\int_a^b x dx$$.
 .
 <p>This is a display equation: <x-equation type="display">\int_a^b x dx</x-equation>.</p>
+.
+--flatex-math
 ````````````````````````````````
 
 Math spans may span multiple lines as they are normal spans:
@@ -30,6 +34,8 @@ f(x) dx
 $$
 .
 <p><x-equation type="display">\int_a^b f(x) dx </x-equation></p>
+.
+--flatex-math
 ````````````````````````````````
 
 Note though that many (simple) renderers may output the math spans just as a
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
index 76cb9df..78d77b9 100755
--- a/test/pathological_tests.py
+++ b/test/pathological_tests.py
@@ -5,19 +5,15 @@ import re
 import argparse
 import sys
 import platform
-from cmark import CMark
+from prog import Prog
 from timeit import default_timer as timer
 
 if __name__ == "__main__":
-    parser = argparse.ArgumentParser(description='Run cmark tests.')
+    parser = argparse.ArgumentParser(description='Run Markdown tests.')
     parser.add_argument('-p', '--program', dest='program', nargs='?', default=None,
             help='program to test')
-    parser.add_argument('--library-dir', dest='library_dir', nargs='?',
-            default=None, help='directory containing dynamic library')
     args = parser.parse_args(sys.argv[1:])
 
-cmark = CMark(prog=args.program, library_dir=args.library_dir)
-
 # list of pairs consisting of input and a regex that must match the output.
 pathological = {
     # note - some pythons have limit of 65535 for {num-matches} in re.
@@ -105,9 +101,15 @@ failed = 0
 
 #print("Testing pathological cases:")
 for description in pathological:
-    (inp, regex) = pathological[description]
+    if len(pathological[description]) == 2:
+        (inp, regex) = pathological[description]
+        prog = Prog(cmdline=args.program)
+    else:
+        (inp, regex, default_options) = pathological[description]
+        prog = Prog(cmdline=args.program, default_options=default_options)
+
     start = timer()
-    [rc, actual, err] = cmark.to_html(inp)
+    [rc, actual, err] = prog.to_html(inp)
     end = timer()
     if rc != 0:
         errored += 1
diff --git a/test/permissive-email-autolinks.txt b/test/permissive-email-autolinks.txt
index 12e8786..f2e8997 100644
--- a/test/permissive-email-autolinks.txt
+++ b/test/permissive-email-autolinks.txt
@@ -12,6 +12,8 @@ This is standard CommonMark e-mail autolink:
 E-mail: <mailto:john.doe@gmail.com>
 .
 <p>E-mail: <a href="mailto:john.doe@gmail.com">mailto:john.doe@gmail.com</a></p>
+.
+--fpermissive-email-autolinks
 ````````````````````````````````
 
 With the permissive autolinks enabled, this is sufficient:
@@ -20,6 +22,8 @@ With the permissive autolinks enabled, this is sufficient:
 E-mail: john.doe@gmail.com
 .
 <p>E-mail: <a href="mailto:john.doe@gmail.com">john.doe@gmail.com</a></p>
+.
+--fpermissive-email-autolinks
 ````````````````````````````````
 
 `+` can occur before the `@`, but not after.
@@ -28,6 +32,8 @@ E-mail: john.doe@gmail.com
 hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.
 .
 <p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p>
+.
+--fpermissive-email-autolinks
 ````````````````````````````````
 
 `.`, `-`, and `_` can occur on both sides of the `@`, but only `.` may occur at
@@ -47,4 +53,6 @@ a.b-c_d@a.b_
 <p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p>
 <p>a.b-c_d@a.b-</p>
 <p>a.b-c_d@a.b_</p>
+.
+--fpermissive-email-autolinks
 ````````````````````````````````
diff --git a/test/permissive-url-autolinks.txt b/test/permissive-url-autolinks.txt
index dfd6b5d..d068499 100644
--- a/test/permissive-url-autolinks.txt
+++ b/test/permissive-url-autolinks.txt
@@ -11,6 +11,8 @@ This is a standard CommonMark autolink:
 Homepage: <https://github.com/mity/md4c>
 .
 <p>Homepage: <a href="https://github.com/mity/md4c">https://github.com/mity/md4c</a></p>
+.
+--fpermissive-url-autolinks
 ````````````````````````````````
 
 With the permissive autolinks enabled, this is sufficient:
@@ -19,6 +21,8 @@ With the permissive autolinks enabled, this is sufficient:
 Homepage: https://github.com/mity/md4c
 .
 <p>Homepage: <a href="https://github.com/mity/md4c">https://github.com/mity/md4c</a></p>
+.
+--fpermissive-url-autolinks
 ````````````````````````````````
 
 But this permissive autolink feature can work only for very widely used URL
@@ -30,6 +34,8 @@ That's why this is not a permissive autolink:
 ssh://root@example.com
 .
 <p>ssh://root@example.com</p>
+.
+--fpermissive-url-autolinks
 ````````````````````````````````
 
 The same rules for path validation as for permissivve WWW autolinks apply.
@@ -39,6 +45,8 @@ Therefore the final question mark here is not part of the autolink:
 Have you ever visited http://www.zombo.com?
 .
 <p>Have you ever visited <a href="http://www.zombo.com">http://www.zombo.com</a>?</p>
+.
+--fpermissive-url-autolinks
 ````````````````````````````````
 
 But in contrast, in this example it is:
@@ -47,6 +55,8 @@ But in contrast, in this example it is:
 http://www.bing.com/search?q=md4c
 .
 <p><a href="http://www.bing.com/search?q=md4c">http://www.bing.com/search?q=md4c</a></p>
+.
+--fpermissive-url-autolinks
 ````````````````````````````````
 
 And finally one complex example:
@@ -61,39 +71,6 @@ Anonymous FTP is available at ftp://foo.bar.baz.
 <p><a href="http://commonmark.org">http://commonmark.org</a></p>
 <p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p>
 <p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p>
-````````````````````````````````
-
-
-## GitHub Issues
-
-### [Issue 53](https://github.com/mity/md4c/issues/53)
-
-```````````````````````````````` example
-This is [link](http://github.com/).
-.
-<p>This is <a href="http://github.com/">link</a>.</p>
-````````````````````````````````
-
-```````````````````````````````` example
-This is [link](http://github.com/)X
-.
-<p>This is <a href="http://github.com/">link</a>X</p>
-````````````````````````````````
-
-
-## [Issue 76](https://github.com/mity/md4c/issues/76)
-
-```````````````````````````````` example
-*(http://example.com)*
-.
-<p><em>(<a href="http://example.com">http://example.com</a>)</em></p>
-````````````````````````````````
-
-
-## [Issue 152](https://github.com/mity/md4c/issues/152)
-
-```````````````````````````````` example
-[http://example.com](http://example.com)
 .
-<p><a href="http://example.com">http://example.com</a></p>
+--fpermissive-url-autolinks
 ````````````````````````````````
diff --git a/test/permissive-www-autolinks.txt b/test/permissive-www-autolinks.txt
index 046de9d..7a3a772 100644
--- a/test/permissive-www-autolinks.txt
+++ b/test/permissive-www-autolinks.txt
@@ -20,6 +20,8 @@ The scheme `http` will be inserted automatically:
 www.commonmark.org
 .
 <p><a href="http://www.commonmark.org">www.commonmark.org</a></p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 After a valid domain, zero or more non-space non-`<` characters may follow:
@@ -28,6 +30,8 @@ After a valid domain, zero or more non-space non-`<` characters may follow:
 Visit www.commonmark.org/help for more information.
 .
 <p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 We then apply extended autolink path validation as follows:
@@ -43,6 +47,8 @@ Visit www.commonmark.org/a.b.
 .
 <p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p>
 <p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 When an autolink ends in `)`, we scan the entire autolink for the total number
@@ -57,6 +63,8 @@ www.google.com/search?q=Markup+(business)
 .
 <p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p>
 <p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 This check is only done when the link ends in a closing parentheses `)`, so if
@@ -67,6 +75,8 @@ applied:
 www.google.com/search?q=(business))+ok
 .
 <p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 If an autolink ends in a semicolon (`;`), we check to see if it appears to
@@ -81,6 +91,8 @@ www.google.com/search?q=commonmark&hl;
 .
 <p><a href="http://www.google.com/search?q=commonmark&amp;hl=en">www.google.com/search?q=commonmark&amp;hl=en</a></p>
 <p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&amp;hl;</p>
+.
+--fpermissive-www-autolinks
 ````````````````````````````````
 
 `<` immediately ends an autolink.
@@ -89,19 +101,6 @@ www.google.com/search?q=commonmark&hl;
 www.commonmark.org/he<lp
 .
 <p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a>&lt;lp</p>
-````````````````````````````````
-
-
-## GitHub Issues
-
-### [Issue 53](https://github.com/mity/md4c/issues/53)
-```````````````````````````````` example
-This is [link](www.github.com/).
-.
-<p>This is <a href="www.github.com/">link</a>.</p>
-````````````````````````````````
-```````````````````````````````` example
-This is [link](www.github.com/)X
 .
-<p>This is <a href="www.github.com/">link</a>X</p>
+--fpermissive-www-autolinks
 ````````````````````````````````
diff --git a/test/prog.py b/test/prog.py
new file mode 100644
index 0000000..fd28df9
--- /dev/null
+++ b/test/prog.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from subprocess import *
+import platform
+import os
+
+def pipe_through_prog(argv, text):
+    p1 = Popen(argv, stdout=PIPE, stdin=PIPE, stderr=PIPE)
+    [result, err] = p1.communicate(input=text.encode('utf-8'))
+    return [p1.returncode, result.decode('utf-8'), err]
+
+class Prog:
+    def __init__(self, cmdline="md2html", default_options=[]):
+        self.cmdline = cmdline.split()
+        if len(self.cmdline) <= 1:
+            # cmdline provided no command line options. Use default ones.
+            if isinstance(default_options, str):
+                self.cmdline += default_options.split()
+            else:
+                self.cmdline += default_options
+        self.to_html = lambda x: pipe_through_prog(self.cmdline, x)
diff --git a/test/regressions.txt b/test/regressions.txt
new file mode 100644
index 0000000..9ac2259
--- /dev/null
+++ b/test/regressions.txt
@@ -0,0 +1,608 @@
+
+# Regressions
+
+These are (mostly) unit tests collected via bug resolving. Adding them here
+prevents us from reintroducing subtle bugs which we've already seen.
+
+
+## [Issue 2](https://github.com/mity/md4c/issues/2)
+
+Raw HTML block:
+
+```````````````````````````````` example
+<gi att1=tok1 att2=tok2>
+.
+<gi att1=tok1 att2=tok2>
+````````````````````````````````
+
+Inline:
+
+```````````````````````````````` example
+foo <gi att1=tok1 att2=tok2> bar
+.
+<p>foo <gi att1=tok1 att2=tok2> bar</p>
+````````````````````````````````
+
+Inline with a line break:
+
+```````````````````````````````` example
+foo <gi att1=tok1
+att2=tok2> bar
+.
+<p>foo <gi att1=tok1
+att2=tok2> bar</p>
+````````````````````````````````
+
+
+## [Issue 4](https://github.com/mity/md4c/issues/4)
+
+```````````````````````````````` example
+![alt text with *entity* &copy;](img.png 'title')
+.
+<p><img src="img.png" alt="alt text with entity ©" title="title"></p>
+````````````````````````````````
+
+
+## [Issue 9](https://github.com/mity/md4c/issues/9)
+
+```````````````````````````````` example
+> [foo
+> bar]: /url
+>
+> [foo bar]
+.
+<blockquote>
+<p><a href="/url">foo
+bar</a></p>
+</blockquote>
+````````````````````````````````
+
+
+## [Issue 10](https://github.com/mity/md4c/issues/10)
+
+```````````````````````````````` example
+[x]:
+x
+- <?
+
+  x
+.
+<ul>
+<li><?
+
+x
+</li>
+</ul>
+````````````````````````````````
+
+
+## [Issue 11](https://github.com/mity/md4c/issues/11)
+
+```````````````````````````````` example
+x [link](/url "foo &ndash; bar") x
+.
+<p>x <a href="/url" title="foo – bar">link</a> x</p>
+````````````````````````````````
+
+
+## [Issue 14](https://github.com/mity/md4c/issues/14)
+
+```````````````````````````````` example
+a***b* c*
+.
+<p>a*<em><em>b</em> c</em></p>
+````````````````````````````````
+
+
+## [Issue 15](https://github.com/mity/md4c/issues/15)
+
+```````````````````````````````` example
+***b* c*
+.
+<p>*<em><em>b</em> c</em></p>
+````````````````````````````````
+
+
+## [Issue 21](https://github.com/mity/md4c/issues/21)
+
+```````````````````````````````` example
+a*b**c*
+.
+<p>a<em>b**c</em></p>
+````````````````````````````````
+
+
+## [Issue 33](https://github.com/mity/md4c/issues/33)
+
+```````````````````````````````` example
+```&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;
+.
+<pre><code class="language-&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;"></code></pre>
+````````````````````````````````
+
+
+## [Issue 36](https://github.com/mity/md4c/issues/36)
+
+```````````````````````````````` example
+__x_ _x___
+.
+<p><em><em>x</em> <em>x</em></em>_</p>
+````````````````````````````````
+
+
+## [Issue 39](https://github.com/mity/md4c/issues/39)
+
+```````````````````````````````` example
+[\\]: x
+.
+````````````````````````````````
+
+
+## [Issue 40](https://github.com/mity/md4c/issues/40)
+
+```````````````````````````````` example
+[x](url
+'title'
+)x
+.
+<p><a href="url" title="title">x</a>x</p>
+````````````````````````````````
+
+
+## [Issue 42](https://github.com/mity/md4c/issues/42)
+
+```````````````````````````````` example
+] http://x.x *x*
+
+|x|x|
+|---|---|
+|x|
+.
+<p>] http://x.x <em>x</em></p>
+<table>
+<thead>
+<tr>
+<th>x</th>
+<th>x</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>x</td>
+<td></td>
+</tr>
+</tbody>
+</table>
+.
+--ftables
+````````````````````````````````
+
+
+## [Issue 53](https://github.com/mity/md4c/issues/53)
+
+```````````````````````````````` example
+This is [link](http://github.com/).
+.
+<p>This is <a href="http://github.com/">link</a>.</p>
+.
+--fpermissive-url-autolinks
+````````````````````````````````
+
+```````````````````````````````` example
+This is [link](http://github.com/)X
+.
+<p>This is <a href="http://github.com/">link</a>X</p>
+.
+--fpermissive-url-autolinks
+````````````````````````````````
+
+
+## [Issue 65](https://github.com/mity/md4c/issues/65)
+
+```````````````````````````````` example
+`
+.
+<p>`</p>
+````````````````````````````````
+
+
+## [Issue 69](https://github.com/mity/md4c/issues/69)
+```````````````````````````````` example
+~`foo`~
+.
+<p><del><code>foo</code></del></p>
+.
+--fstrikethrough
+````````````````````````````````
+
+```````````````````````````````` example
+~*foo*~
+.
+<p><del><em>foo</em></del></p>
+.
+--fstrikethrough
+````````````````````````````````
+
+```````````````````````````````` example
+*~foo~*
+.
+<p><em><del>foo</del></em></p>
+.
+--fstrikethrough
+````````````````````````````````
+
+
+## [Issue 74](https://github.com/mity/md4c/issues/74)
+
+```````````````````````````````` example
+[f]:
+-
+    xx
+-
+.
+<pre><code>xx
+</code></pre>
+<ul>
+<li></li>
+</ul>
+````````````````````````````````
+
+
+## [Issue 76](https://github.com/mity/md4c/issues/76)
+
+```````````````````````````````` example
+*(http://example.com)*
+.
+<p><em>(<a href="http://example.com">http://example.com</a>)</em></p>
+.
+--fpermissive-url-autolinks
+````````````````````````````````
+
+
+## [Issue 78](https://github.com/mity/md4c/issues/78)
+
+```````````````````````````````` example
+[SS ẞ]: /url
+[ẞ SS]
+.
+<p><a href="/url">ẞ SS</a></p>
+````````````````````````````````
+
+
+## [Issue 83](https://github.com/mity/md4c/issues/83)
+
+```````````````````````````````` example
+foo
+>
+.
+<p>foo</p>
+<blockquote>
+</blockquote>
+
+````````````````````````````````
+
+
+## [Issue 95](https://github.com/mity/md4c/issues/95)
+
+```````````````````````````````` example
+. foo
+.
+<p>. foo</p>
+````````````````````````````````
+
+
+## [Issue 96](https://github.com/mity/md4c/issues/96)
+
+```````````````````````````````` example
+[ab]: /foo
+[a] [ab] [abc]
+.
+<p>[a] <a href="/foo">ab</a> [abc]</p>
+````````````````````````````````
+
+```````````````````````````````` example
+[a b]: /foo
+[a   b]
+.
+<p><a href="/foo">a   b</a></p>
+````````````````````````````````
+
+
+## [Issue 97](https://github.com/mity/md4c/issues/97)
+
+```````````````````````````````` example
+*a **b c* d**
+.
+<p><em>a <em><em>b c</em> d</em></em></p>
+
+````````````````````````````````
+
+
+## [Issue 100](https://github.com/mity/md4c/issues/100)
+
+```````````````````````````````` example
+<foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123>
+.
+<p><a href="mailto:foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123">foo@123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123</a></p>
+````````````````````````````````
+
+```````````````````````````````` example
+<foo@123456789012345678901234567890123456789012345678901234567890123x.123456789012345678901234567890123456789012345678901234567890123>
+.
+<p>&lt;foo@123456789012345678901234567890123456789012345678901234567890123x.123456789012345678901234567890123456789012345678901234567890123&gt;</p>
+````````````````````````````````
+(Note the `x` here which turns it over the max. allowed length limit.)
+
+
+## [Issue 104](https://github.com/mity/md4c/issues/104)
+
+```````````````````````````````` example
+A | B
+--- | ---
+[x](url)
+.
+<table>
+<thead>
+<tr>
+<th>A</th>
+<th>B</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href="url">x</a></td>
+<td></td>
+</tr>
+</tbody>
+</table>
+.
+--ftables
+````````````````````````````````
+
+
+## [Issue 107](https://github.com/mity/md4c/issues/107)
+
+```````````````````````````````` example
+***foo *bar baz***
+.
+<p>*<strong>foo <em>bar baz</em></strong></p>
+
+````````````````````````````````
+
+
+## [Issue 124](https://github.com/mity/md4c/issues/124)
+
+```````````````````````````````` example
+~~~
+                x
+~~~
+
+~~~
+                 x
+~~~
+.
+<pre><code>                x
+</code></pre>
+<pre><code>                 x
+</code></pre>
+````````````````````````````````
+
+
+## [Issue 131](https://github.com/mity/md4c/issues/131)
+
+```````````````````````````````` example
+[![alt][img]][link]
+
+[img]: img_url
+[link]: link_url
+.
+<p><a href="link_url"><img src="img_url" alt="alt"></a></p>
+````````````````````````````````
+
+
+## [Issue 138](https://github.com/mity/md4c/issues/138)
+
+```````````````````````````````` example
+| abc | def |
+| --- | --- |
+.
+<table>
+<thead>
+<tr>
+<th>abc</th>
+<th>def</th>
+</tr>
+</thead>
+</table>
+.
+--ftables
+````````````````````````````````
+
+
+## [Issue 142](https://github.com/mity/md4c/issues/142)
+
+```````````````````````````````` example
+[fooﬗ]: /url
+[fooﬕ]
+.
+<p>[fooﬕ]</p>
+````````````````````````````````
+
+
+## [Issue 149](https://github.com/mity/md4c/issues/149)
+
+```````````````````````````````` example
+- <script>
+- foo
+bar
+</script>
+.
+<ul>
+<li><script>
+</li>
+<li>foo
+bar
+</script></li>
+</ul>
+````````````````````````````````
+
+
+## [Issue 152](https://github.com/mity/md4c/issues/152)
+
+```````````````````````````````` example
+[http://example.com](http://example.com)
+.
+<p><a href="http://example.com">http://example.com</a></p>
+.
+--fpermissive-url-autolinks
+````````````````````````````````
+
+
+## [Issue 190](https://github.com/mity/md4c/issues/190)
+
+```````````````````````````````` example
+-
+
+    foo
+.
+<ul>
+<li></li>
+</ul>
+<pre><code>foo
+</code></pre>
+````````````````````````````````
+
+
+## [Issue 200](https://github.com/mity/md4c/issues/200)
+
+```````````````````````````````` example
+<!-- foo -->
+    ```
+    bar
+    ```
+.
+<!-- foo -->
+<pre><code>```
+bar
+```
+</code></pre>
+````````````````````````````````
+
+
+## [Issue 201](https://github.com/mity/md4c/issues/201)
+
+```````````````````````````````` example
+foo
+    ```
+    bar
+    ```
+.
+<p>foo
+<code>bar</code></p>
+````````````````````````````````
+
+
+## [Issue 207](https://github.com/mity/md4c/issues/207)
+
+```````````````````````````````` example
+<textarea>
+
+*foo*
+
+_bar_
+
+</textarea>
+
+baz
+.
+<textarea>
+
+*foo*
+
+_bar_
+
+</textarea>
+<p>baz</p>
+````````````````````````````````
+
+
+## [Issue 210](https://github.com/mity/md4c/issues/210)
+
+```````````````````````````````` example
+![outer ![inner](img_inner "inner title")](img_outer "outer title")
+.
+<p><img src="img_outer" alt="outer inner" title="outer title"></p>
+````````````````````````````````
+
+
+## [Issue 212](https://github.com/mity/md4c/issues/212)
+
+```````````````````````````````` example
+x
+|-
+|[*x*]()
+.
+<table>
+<thead>
+<tr>
+<th>x</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href=""><em>x</em></a></td>
+</tr>
+</tbody>
+</table>
+.
+--ftables
+````````````````````````````````
+
+
+## [Issue 215](https://github.com/mity/md4c/issues/215)
+
+```````````````````````````````` example
+title
+--→
+.
+<h2>title</h2>
+````````````````````````````````
+
+
+## [Issue 216](https://github.com/mity/md4c/issues/216)
+
+```````````````````````````````` example
+x <!A>
+.
+<p>x <!A></p>
+````````````````````````````````
+
+
+## [Issue 217](https://github.com/mity/md4c/issues/217)
+
+```````````````````````````````` example
+__!_!__
+
+__!x!__
+
+**!*!**
+
+---
+
+_*__*_*
+
+_*xx*_*
+
+_*__-_-
+
+_*xx-_-
+.
+<p><strong>!_!</strong></p>
+<p><strong>!x!</strong></p>
+<p><strong>!*!</strong></p>
+<hr />
+<p><em><em>__</em></em>*</p>
+<p><em><em>xx</em></em>*</p>
+<p><em>*__-</em>-</p>
+<p><em>*xx-</em>-</p>
+````````````````````````````````
diff --git a/test/spec_tests.py b/test/spec_tests.py
index c739e5f..50f1252 100755
--- a/test/spec_tests.py
+++ b/test/spec_tests.py
@@ -6,19 +6,17 @@ from difflib import unified_diff
 import argparse
 import re
 import json
-from cmark import CMark
+from prog import Prog
 from normalize import normalize_html
 
 if __name__ == "__main__":
-    parser = argparse.ArgumentParser(description='Run cmark tests.')
+    parser = argparse.ArgumentParser(description='Run Markdown tests.')
     parser.add_argument('-p', '--program', dest='program', nargs='?', default=None,
             help='program to test')
     parser.add_argument('-s', '--spec', dest='spec', nargs='?', default='spec.txt',
             help='path to spec')
     parser.add_argument('-P', '--pattern', dest='pattern', nargs='?',
             default=None, help='limit to sections matching regex pattern')
-    parser.add_argument('--library-dir', dest='library_dir', nargs='?',
-            default=None, help='directory containing dynamic library')
     parser.add_argument('--no-normalize', dest='normalize',
             action='store_const', const=False, default=True,
             help='do not normalize HTML')
@@ -39,7 +37,8 @@ def print_test_header(headertext, example_number, start_line, end_line):
     out("Example %d (lines %d-%d) %s\n" % (example_number,start_line,end_line,headertext))
 
 def do_test(test, normalize, result_counts):
-    [retcode, actual_html, err] = cmark.to_html(test['markdown'])
+    prog = Prog(cmdline=args.program, default_options=test['cmdline_options'])
+    [retcode, actual_html, err] = prog.to_html(test['markdown'])
     if retcode == 0:
         expected_html = test['html']
         unicode_error = None
@@ -81,6 +80,7 @@ def get_tests(specfile):
     example_number = 0
     markdown_lines = []
     html_lines = []
+    cmdline_lines = []
     state = 0  # 0 regular text, 1 markdown example, 2 html output
     headertext = ''
     tests = []
@@ -91,16 +91,16 @@ def get_tests(specfile):
         for line in specf:
             line_number = line_number + 1
             l = line.strip()
-            #if l == "`" * 32 + " example":
             if re.match("`{32} example( [a-z]{1,})?", l):
                 state = 1
-            elif state == 2 and l == "`" * 32:
+            elif state >= 2 and l == "`" * 32:
                 state = 0
                 example_number = example_number + 1
                 end_line = line_number
                 tests.append({
                     "markdown":''.join(markdown_lines).replace('→',"\t"),
                     "html":''.join(html_lines).replace('→',"\t"),
+                    "cmdline_options":''.join(cmdline_lines),
                     "example": example_number,
                     "start_line": start_line,
                     "end_line": end_line,
@@ -108,14 +108,17 @@ def get_tests(specfile):
                 start_line = 0
                 markdown_lines = []
                 html_lines = []
+                cmdline_lines = []
             elif l == ".":
-                state = 2
+                state += 1
             elif state == 1:
                 if start_line == 0:
                     start_line = line_number - 1
                 markdown_lines.append(line)
             elif state == 2:
                 html_lines.append(line)
+            elif state == 3:
+                cmdline_lines.append(line)
             elif state == 0 and re.match(header_re, line):
                 headertext = header_re.sub('', line).strip()
     return tests
@@ -136,7 +139,6 @@ if __name__ == "__main__":
         exit(0)
     else:
         skipped = len(all_tests) - len(tests)
-        cmark = CMark(prog=args.program, library_dir=args.library_dir)
         result_counts = {'pass': 0, 'fail': 0, 'error': 0, 'skip': skipped}
         for test in tests:
             do_test(test, args.normalize, result_counts)
diff --git a/test/strikethrough.txt b/test/strikethrough.txt
index 884ce59..06610f5 100644
--- a/test/strikethrough.txt
+++ b/test/strikethrough.txt
@@ -10,6 +10,8 @@ Strike-through text is any text wrapped in one or two tildes (`~`).
 ~Hi~ Hello, world!
 .
 <p><del>Hi</del> Hello, world!</p>
+.
+--fstrikethrough
 ````````````````````````````````
 
 If the length of the opener and closer doesn't match, the strike-through is
@@ -19,6 +21,8 @@ not recognized.
 This ~text~~ is curious.
 .
 <p>This ~text~~ is curious.</p>
+.
+--fstrikethrough
 ````````````````````````````````
 
 Too long tilde sequence won't be recognized:
@@ -27,6 +31,8 @@ Too long tilde sequence won't be recognized:
 foo ~~~bar~~~
 .
 <p>foo ~~~bar~~~</p>
+.
+--fstrikethrough
 ````````````````````````````````
 
 Also note the markers cannot open a strike-through span if they are followed
@@ -37,6 +43,8 @@ preceded with a whitespace:
 ~foo ~bar
 .
 <p>~foo ~bar</p>
+.
+--fstrikethrough
 ````````````````````````````````
 
 
@@ -50,26 +58,6 @@ new paragraph~~.
 .
 <p>This ~~has a</p>
 <p>new paragraph~~.</p>
-````````````````````````````````
-
-
-## GitHub Issues
-
-### [Issue 69](https://github.com/mity/md4c/issues/69)
-```````````````````````````````` example
-~`foo`~
-.
-<p><del><code>foo</code></del></p>
-````````````````````````````````
-
-```````````````````````````````` example
-~*foo*~
-.
-<p><del><em>foo</em></del></p>
-````````````````````````````````
-
-```````````````````````````````` example
-*~foo~*
 .
-<p><em><del>foo</del></em></p>
+--fstrikethrough
 ````````````````````````````````
diff --git a/test/tables.txt b/test/tables.txt
index cd62100..8f2da38 100644
--- a/test/tables.txt
+++ b/test/tables.txt
@@ -24,6 +24,8 @@ counting the header) is as follows:
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 The leading and succeeding pipe characters (`|`) on each line are optional:
@@ -45,6 +47,8 @@ quux     | quuz     |
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 ```````````````````````````````` example
@@ -64,6 +68,8 @@ quux     | quuz     |
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 ```````````````````````````````` example
@@ -83,6 +89,8 @@ quux     | quuz
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 However for one-column table, at least one pipe has to be used in the table
@@ -100,6 +108,8 @@ quux
 <p>foo
 baz
 quux</p>
+.
+--ftables
 ````````````````````````````````
 
 Leading and trailing whitespace in a table cell is ignored and the columns do
@@ -122,6 +132,8 @@ quux|quuz
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 The table cannot interrupt a paragraph.
@@ -163,6 +175,8 @@ Lorem ipsum dolor sit amet.
 <tr><td>Lorem ipsum dolor sit amet.</td><td></td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 The first, the last or both the first and the last dash in each column
@@ -182,6 +196,8 @@ alignment of the respective column:
 <tr><td>default</td><td align="left">left</td><td align="center">center</td><td align="right">right</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 To include a literal pipe character in any cell, it has to be escaped.
@@ -203,6 +219,8 @@ quux     | quuz
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 Contents of each cell is parsed as an inline text which may contents any
@@ -227,6 +245,8 @@ quux     | [quuz](/url2)
 <tr><td>quux</td><td><a href="/url2">quuz</a></td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 However pipes which are inside a code span are not recognized as cell
@@ -249,12 +269,14 @@ quux     | quuz
 <tr><td>quux</td><td>quuz</td></tr>
 </tbody>
 </table>
+.
+--ftables
 ````````````````````````````````
 
 
 ## GitHub Issues
 
-### [Issue 41](https://github.com/mity/md4c/issues/41)
+## [Issue 41](https://github.com/mity/md4c/issues/41)
 ```````````````````````````````` example
 * x|x
 ---|---
@@ -263,6 +285,8 @@ quux     | quuz
 <li>x|x
 ---|---</li>
 </ul>
+.
+--ftables
 ````````````````````````````````
 (Not a table, because the underline has wrong indentation and is not part of the
 list item.)
@@ -284,96 +308,9 @@ x|x
 </li>
 </ul>
 <p>x|x</p>
+.
+--ftables
 ````````````````````````````````
 (Here the underline has the right indentation so the table is detected.
 But the last line is not part of it due its indentation.)
 
-
-### [Issue 42](https://github.com/mity/md4c/issues/42)
-
-```````````````````````````````` example
-] http://x.x *x*
-
-|x|x|
-|---|---|
-|x|
-.
-<p>] http://x.x <em>x</em></p>
-<table>
-<thead>
-<tr>
-<th>x</th>
-<th>x</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>x</td>
-<td></td>
-</tr>
-</tbody>
-</table>
-````````````````````````````````
-
-
-### [Issue 104](https://github.com/mity/md4c/issues/104)
-
-```````````````````````````````` example
-A | B
---- | ---
-[x](url)
-.
-<table>
-<thead>
-<tr>
-<th>A</th>
-<th>B</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="url">x</a></td>
-<td></td>
-</tr>
-</tbody>
-</table>
-````````````````````````````````
-
-
-### [Issue 138](https://github.com/mity/md4c/issues/138)
-
-```````````````````````````````` example
-| abc | def |
-| --- | --- |
-.
-<table>
-<thead>
-<tr>
-<th>abc</th>
-<th>def</th>
-</tr>
-</thead>
-</table>
-````````````````````````````````
-
-
-### [Issue 212](https://github.com/mity/md4c/issues/212)
-
-```````````````````````````````` example
-x
-|-
-|[*x*]()
-.
-<table>
-<thead>
-<tr>
-<th>x</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href=""><em>x</em></a></td>
-</tr>
-</tbody>
-</table>
-````````````````````````````````
diff --git a/test/tasklists.txt b/test/tasklists.txt
index aae1bf8..59de3f1 100644
--- a/test/tasklists.txt
+++ b/test/tasklists.txt
@@ -16,6 +16,8 @@ Basic task list may look as follows:
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled checked>bar</li>
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled>baz</li>
 </ul>
+.
+--ftasklists
 ````````````````````````````````
 
 Task lists can also be in ordered lists:
@@ -30,6 +32,8 @@ Task lists can also be in ordered lists:
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled checked>bar</li>
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled>baz</li>
 </ol>
+.
+--ftasklists
 ````````````````````````````````
 
 Task lists can also be nested in ordinary lists:
@@ -58,6 +62,8 @@ Task lists can also be nested in ordinary lists:
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled>quuz</li>
 </ul></li>
 </ul>
+.
+--ftasklists
 ````````````````````````````````
 
 Or in a parent task list:
@@ -86,6 +92,8 @@ Or in a parent task list:
 <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled>quuz</li>
 </ul></li>
 </ol>
+.
+--ftasklists
 ````````````````````````````````
 
 Also, ordinary lists can be nested in the task lists.
@@ -114,4 +122,6 @@ Also, ordinary lists can be nested in the task lists.
 <li>quuz</li>
 </ul></li>
 </ul>
+.
+--ftasklists
 ````````````````````````````````
diff --git a/test/underline.txt b/test/underline.txt
index 289e97f..d7e66ac 100644
--- a/test/underline.txt
+++ b/test/underline.txt
@@ -9,6 +9,8 @@ emphasis).
 _foo_
 .
 <p><u>foo</u></p>
+.
+--funderline
 ````````````````````````````````
 
 In sequences of multiple underscores, each single one translates into an
@@ -18,6 +20,8 @@ underline span mark.
 ___foo___
 .
 <p><u><u><u>foo</u></u></u></p>
+.
+--funderline
 ````````````````````````````````
 
 Intra-word underscores are not recognized as underline marks:
@@ -26,6 +30,8 @@ Intra-word underscores are not recognized as underline marks:
 foo_bar_baz
 .
 <p>foo_bar_baz</p>
+.
+--funderline
 ````````````````````````````````
 
 Also the parser follows the standard understanding when the underscore can
@@ -36,4 +42,6 @@ example because no underline can be seen as a closing mark.
 _foo _bar
 .
 <p>_foo _bar</p>
+.
+--funderline
 ````````````````````````````````
diff --git a/test/wiki-links.txt b/test/wiki-links.txt
index 00d394e..0793a32 100644
--- a/test/wiki-links.txt
+++ b/test/wiki-links.txt
@@ -10,6 +10,8 @@ The simple wiki-link is a wiki-link destination enclosed in `[[` followed with
 [[foo]]
 .
 <p><x-wikilink data-target="foo">foo</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 However wiki-link may contain an explicit label, delimited from the destination
@@ -19,6 +21,8 @@ with `|`.
 [[foo|bar]]
 .
 <p><x-wikilink data-target="foo">bar</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 A wiki-link destination cannot be empty.
@@ -27,12 +31,16 @@ A wiki-link destination cannot be empty.
 [[]]
 .
 <p>[[]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 ```````````````````````````````` example
 [[|foo]]
 .
 <p>[[|foo]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 
@@ -44,6 +52,8 @@ bar]]
 .
 <p>[[foo
 bar]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 ```````````````````````````````` example
@@ -52,6 +62,8 @@ bar|baz]]
 .
 <p>[[foo
 bar|baz]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 The wiki-link destination is rendered verbatim; inline markup in it is not
@@ -61,12 +73,16 @@ recognized.
 [[*foo*]]
 .
 <p><x-wikilink data-target="*foo*">*foo*</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 ```````````````````````````````` example
 [[foo|![bar](bar.jpg)]]
 .
 <p><x-wikilink data-target="foo"><img src="bar.jpg" alt="bar"></x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 With multiple `|` delimiters, only the first one is recognized and the other
@@ -76,6 +92,8 @@ ones are part of the label.
 [[foo|bar|baz]]
 .
 <p><x-wikilink data-target="foo">bar|baz</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 However the delimiter `|` can be escaped with `/`.
@@ -84,6 +102,8 @@ However the delimiter `|` can be escaped with `/`.
 [[foo\|bar|baz]]
 .
 <p><x-wikilink data-target="foo|bar">baz</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 The label can contain inline elements.
@@ -92,6 +112,8 @@ The label can contain inline elements.
 [[foo|*bar*]]
 .
 <p><x-wikilink data-target="foo"><em>bar</em></x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Empty explicit label is the same as using the implicit label; i.e. the verbatim
@@ -101,6 +123,8 @@ destination string is used as the label.
 [[foo|]]
 .
 <p><x-wikilink data-target="foo">foo</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 The label can span multiple lines.
@@ -113,6 +137,8 @@ baz]]
 <p><x-wikilink data-target="foo">foo
 bar
 baz</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Wiki-links have higher priority than links.
@@ -121,6 +147,8 @@ Wiki-links have higher priority than links.
 [[foo]](foo.jpg)
 .
 <p><x-wikilink data-target="foo">foo</x-wikilink>(foo.jpg)</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 ```````````````````````````````` example
@@ -129,6 +157,8 @@ Wiki-links have higher priority than links.
 [[foo]]
 .
 <p><x-wikilink data-target="foo">foo</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Wiki links can be inlined in tables.
@@ -152,6 +182,8 @@ Wiki links can be inlined in tables.
 </tr>
 </tbody>
 </table>
+.
+--fwiki-links --ftables
 ````````````````````````````````
 
 Wiki-links are not prioritized over images.
@@ -160,6 +192,8 @@ Wiki-links are not prioritized over images.
 ![[foo]](foo.jpg)
 .
 <p><img src="foo.jpg" alt="[foo]"></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Something that may look like a wiki-link at first, but turns out not to be,
@@ -171,6 +205,8 @@ is recognized as a normal link.
 [foo]: /url
 .
 <p>[<a href="/url">foo</a></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Escaping the opening `[` escapes only that one character, not the whole `[[`
@@ -182,6 +218,8 @@ opener:
 [foo]: /url
 .
 <p>[<a href="/url">foo</a>]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 Like with other inline links, the innermost wiki-link is preferred.
@@ -190,6 +228,8 @@ Like with other inline links, the innermost wiki-link is preferred.
 [[foo[[bar]]]]
 .
 <p>[[foo<x-wikilink data-target="bar">bar</x-wikilink>]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 There is limit of 100 characters for the wiki-link destination.
@@ -200,6 +240,8 @@ There is limit of 100 characters for the wiki-link destination.
 .
 <p>[[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901]]
 [[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901|foo]]</p>
+.
+--fwiki-links
 ````````````````````````````````
 
 100 characters inside a wiki link target works.
@@ -210,6 +252,8 @@ There is limit of 100 characters for the wiki-link destination.
 .
 <p><x-wikilink data-target="1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</x-wikilink>
 <x-wikilink data-target="1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890">foo</x-wikilink></p>
+.
+--fwiki-links
 ````````````````````````````````
 
 The limit on link content does not include any characters belonging to a block
@@ -229,4 +273,6 @@ quote, if the label spans multiple lines contained in a block quote.
 1234567890
 123456789</x-wikilink></p>
 </blockquote>
+.
+--fwiki-links
 ````````````````````````````````