-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathDevelopmentNotes.fodt
More file actions
3394 lines (2608 loc) · 131 KB
/
Copy pathDevelopmentNotes.fodt
File metadata and controls
3394 lines (2608 loc) · 131 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
xmlns:math="http://www.w3.org/1998/Math/MathML"
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
xmlns:ooo="http://openoffice.org/2004/office"
xmlns:ooow="http://openoffice.org/2004/writer"
xmlns:oooc="http://openoffice.org/2004/calc"
xmlns:dom="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rpt="http://openoffice.org/2005/report"
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:grddl="http://www.w3.org/2003/g/data-view#"
xmlns:officeooo="http://openoffice.org/2009/office"
xmlns:tableooo="http://openoffice.org/2009/table"
xmlns:drawooo="http://openoffice.org/2010/draw"
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
xmlns:css3t="http://www.w3.org/TR/css3-text/"
office:version="1.2"
office:mimetype="application/vnd.oasis.opendocument.text">
<office:font-face-decls>
<style:font-face style:name="Courier New" svg:font-family="'Courier New'"
style:font-adornments="Regular"
style:font-family-generic="modern"
style:font-pitch="fixed"/>
</office:font-face-decls>
<office:styles>
<style:style style:name="Standard" style:family="paragraph" style:class="text">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in" fo:text-align="justify" style:justify-single-word="false"/>
</style:style>
<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
style:justify-single-word="false"/>
<style:text-properties style:font-name="Courier New" fo:font-size="11pt"
style:font-name-asian="Courier New"
style:font-size-asian="11pt"
style:font-name-complex="Courier New"
style:font-size-complex="11pt"/>
</style:style>
<style:style style:name="Source_20_Text" style:display-name="Source Text"
style:family="text">
<style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
style:font-name-complex="Courier New"
fo:font-size="11pt"/>
</style:style>
<style:style style:name="List" style:family="paragraph"
style:parent-style-name="Standard"
style:class="list">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
<style:text-properties style:font-size-asian="12pt"/>
</style:style>
<style:style style:name="Quotations" style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
fo:margin-bottom="0.1965in"
fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0in"
style:auto-text-indent="false"/>
</style:style>
<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
style:family="paragraph"
style:parent-style-name="Table_20_Contents"
style:class="extra">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
text:number-lines="false"
text:line-number="0"/>
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
fo:padding="0in"
fo:border-left="none"
fo:border-right="none"
fo:border-top="none"
fo:border-bottom="0.0154in double #808080"
text:number-lines="false"
text:line-number="0"
style:join-border="false"/>
<style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
</style:style>
<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor" style:family="text"> <style:text-properties style:text-position="super 58%"/> </style:style>
<style:style style:name="TOC_Item" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties>
<style:tab-stops>
<style:tab-stop style:position="6.7283in" style:type="right" style:leader-style="dotted" style:leader-text="."/>
</style:tab-stops>
</style:paragraph-properties>
</style:style>
<text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
<text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
</office:styles>
<office:automatic-styles> <style:style style:name="MMD-Italic" style:family="text">
<style:text-properties fo:font-style="italic" style:font-style-asian="italic"
style:font-style-complex="italic"/>
</style:style>
<style:style style:name="MMD-Bold" style:family="text">
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="MMD-Superscript" style:family="text">
<style:text-properties style:text-position="super 58%"/>
</style:style>
<style:style style:name="MMD-Subscript" style:family="text">
<style:text-properties style:text-position="sub 58%"/>
</style:style>
<style:style style:name="Strike" style:family="text">
<style:text-properties style:text-line-through-style="solid" />
</style:style>
<style:style style:name="Underline" style:family="text">
<style:text-properties style:text-underline-style="solid" style:text-underline-color="font-color"/>
</style:style>
<style:style style:name="Highlight" style:family="text">
<style:text-properties fo:background-color="#FFFF00" />
</style:style>
<style:style style:name="Comment" style:family="text">
<style:text-properties fo:color="#0000BB" />
</style:style>
<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
</style:style>
<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
</style:style>
<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
<style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
</style:style>
<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
style:list-style-name="L2">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
</style:style>
<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
<style:graphic-properties style:print-content="true" style:vertical-pos="top"
style:vertical-rel="baseline"
fo:padding="0in"
fo:border="none"
style:shadow="none"/>
</style:style>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
style:list-style-name="L1"/>
<text:list-style style:name="L1">
<text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
</text:list-style>
<text:list-style style:name="L2">
<text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
</text:list-style>
</office:automatic-styles>
<office:master-styles>
<style:master-page style:name="Endnote" >
<style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
<style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
</office:master-styles>
<office:meta>
<dc:title>MultiMarkdown v6 Development Notes</dc:title>
<dc:creator>Fletcher T. Penney</dc:creator>
<meta:user-defined meta:name="date">2023-06-10</meta:user-defined>
<meta:user-defined meta:name="uuid">dd2d8e76-dc2d-416d-9acd-5395d20871c2</meta:user-defined>
</office:meta>
<office:body>
<office:text>
<text:h text:outline-level="3"><text:bookmark text:name="introduction"/>Introduction</text:h>
<text:p text:style-name="Standard">This document includes some notes on the development of MultiMarkdown (MMD) v6. Most of it
will be interesting only to other developers or those needing to choose the
absolute “best” Markdown (MD) implementation for their needs – it is not required
reading to understand how the software works.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="whyanewversion"/>Why a New Version?</text:h>
<text:p text:style-name="Standard">MultiMarkdown version 5 was released in November of 2015, but the codebase was
essentially the same as that of v4 – and that was released in beta in April
of 2013. A few key things prompted work on a new version:</text:p>
<text:list text:style-name="L1">
<text:list-item>
<text:p text:style-name="Standard">Accuracy – MMD v4 and v5 were the most accurate versions yet, and a lot of
effort went into finding and resolving various edge cases. However, it began
to feel like a game of whack-a-mole where new bugs would creep in every time I
fixed an old one. The PEG<text:note text:id="gn1" text:note-class="glossary"><text:note-body><text:p text:style-name="Footnote">Parsing Expression Grammar <text:a xlink:type="simple" xlink:href="https://en.wikipedia.org/wiki/Parsing_expression_grammar">https://en.wikipedia.org/wiki/Parsing_expression_grammar</text:a></text:p></text:note-body></text:note> began to feel rather convoluted in spots, even
though it did allow for a precise (if not always accurate) specification of
the grammar.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Performance – “Back in the day” <text:a xlink:type="simple" xlink:href="https://github.com/jgm/peg-markdown">peg-markdown</text:a> was one of the fastest
Markdown parsers around. MMD v3 was based on peg-markdown, and would leap-
frog with it in terms of performance. Then <text:a xlink:type="simple" xlink:href="http://commonmark.org/">CommonMark</text:a> was released, which
was a bit faster. Then a couple of years went by and CommonMark became <text:span text:style-name="MMD-Italic">much</text:span>
faster – in one of my test suites, MMD v 5.4.0 takes about 25 times longer to
process a long document than CommonMark 0.27.0.</text:p></text:list-item>
</text:list>
<text:p text:style-name="Standard">In the spring of 2016, I decided I wanted to rewrite MultiMarkdown from scratch,
building the parser myself rather than relying on a pre-rolled solution. (I
had been using <text:a xlink:type="simple" xlink:href="https://github.com/ooc-lang/greg">greg</text:a> to compile the PEG
into parser code. It worked well overall, but lacked some features I needed,
requiring a lot of workarounds.)</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="firstattempt"/>First Attempt</text:h>
<text:p text:style-name="Standard">My first attempt started by hand-crafting a parser that scanned through the
document a line at a time, deciding what to do with each line as it found
them. I used regex parsers made with <text:a xlink:type="simple" xlink:href="http://re2c.org/index.html">re2c</text:a> to
help classify each line, and then a separate parser layer to process groups of
lines into blocks. Initially this approach worked well, and was really
efficient. But I quickly began to code my way into a dead-end – the strategy
was not elegant enough to handle things like nested lists, etc.</text:p>
<text:p text:style-name="Standard">One thing that did turn out well from the first attempt, however, was an
approach for handling <text:span text:style-name="Source_20_Text"><emph></text:span> and <text:span text:style-name="Source_20_Text"><strong></text:span> parsing. I’ve learned over the
years that this can be one of the hardest parts of coding accurately for
Markdown. There are many examples that are obvious to a person, but difficult
to properly “explain” how to parse to a computer.</text:p>
<text:p text:style-name="Standard">No solution is perfect, but I developed an approach that seems to accurately
handle a wide range of situations without a great deal of complexity:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">Scan the documents for asterisks (<text:span text:style-name="Source_20_Text">*</text:span>). Each one will be handled one at a
time.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Unlike brackets (<text:span text:style-name="Source_20_Text">[</text:span> and <text:span text:style-name="Source_20_Text">]</text:span>), an asterisk is “ambidextrous”, in that it
may be able to open a matched pair of asterisks, close a pair, or both. For
example, in <text:span text:style-name="Source_20_Text">foo *bar* foo</text:span>:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">The first asterisk can open a pair, but not close one.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">The second asterisk can close a pair, but not open one.</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">So, once the asterisks have been identified, each has to be examined to
determine whether it can open/close/both. The algorithm is not that complex,
but I’ll describe it in general terms. Check the code for more specifics.
This approach seems to work, but might still need some slight tweaking. In
the future, I’ll codify this better in language rather than just in code.</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">If there is whitespace to the left of an asterisk, it can’t close.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">If there is whitespace or punctuation to the right it can’t open.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">“Runs” of asterisks, e.g. <text:span text:style-name="Source_20_Text">**bar</text:span> are treated as a unit in terms of
looking left/right.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Asterisks inside a word are a bit trickier – we look at the number of
asterisks before the word, the number in the current run, and the number
of asterisks after the word to determine which combinations, if any, are
permitted.</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Once all asterisks have been tagged as able to open/close/both, we proceed
through them in order:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">When we encounter a tag that can close, we look to see if there is a
previous opener that has not been paired off. If so, pair the two and
remove the opener from the list of available asterisks.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">When we encounter an opener, add it to the stack of available openers.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">When encounter an asterisk that can do both, see if it can close an
existing opener. If not, then add it to the stack.</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">After all tokens in the block have been paired, then we look for nesting
pairs of asterisks in order to create <text:span text:style-name="Source_20_Text"><emph></text:span> and <text:span text:style-name="Source_20_Text"><strong></text:span> sets. For
example, assume we have six asterisks wrapped around a word, three in front,
and three after. The asterisks are indicated with numbers: <text:span text:style-name="Source_20_Text">123foo456</text:span>. We
proceed in the following manner:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">Based on the pairing algorithm above, these asterisks would be paired as
follows, with matching asterisks sharing numbers – <text:span text:style-name="Source_20_Text">123foo321</text:span>.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Moving forwards, we come to asterisk “1”. It is followed by an
asterisk, so we check to see if they should be grouped as a <text:span text:style-name="Source_20_Text"><strong></text:span>.
Since the “1” asterisks are wrapped immediately outside the “2” asterisks,
they are joined together. More than two pairs can’t be joined, so we now
get the following – <text:span text:style-name="Source_20_Text">112foo211</text:span>, where the “11” represents the opening
and closing of a <text:span text:style-name="Source_20_Text"><strong></text:span>, and the “2” represents a <text:span text:style-name="Source_20_Text"><emph></text:span>.</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">When matching a pair, any unclosed openers that are on the stack are
removed, preventing pairs from “crossing” or “intersecting”. Pairs can wrap
around each other, e.g. <text:span text:style-name="Source_20_Text">[(foo)]</text:span>, but not intersect like <text:span text:style-name="Source_20_Text">[(foo])</text:span>. In the
second case, the brackets would close, removing the <text:span text:style-name="Source_20_Text">(</text:span> from the stack.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">This same approach is used in all tokens that are matched in pairs–
<text:span text:style-name="Source_20_Text">[foo]</text:span>, <text:span text:style-name="Source_20_Text">(foo)</text:span>, <text:span text:style-name="Source_20_Text">_foo_</text:span>, etc. There’s slightly more to it, but once you
figure out how to assign opening/closing ability, the rest is easy. By using
a stack to track available openers, it can be performed efficiently.</text:p></text:list-item>
</text:list>
<text:p text:style-name="Standard">In my testing, this approach has worked quite well. It handles all the basic
scenarios I’ve thrown at it, and all of the “basic” and “devious” edge cases I
have thought of (some of these don’t necessarily have a “right” answer – but
v6 gives consistency answers that seem as reasonable as any others to me).
There are also three more edge cases I’ve come up can still stump it, and
ironically they are handled correctly by most implementations. They just
don’t follow the rules above. I’ll continue to work on this.</text:p>
<text:p text:style-name="Standard">In the end, I scrapped this effort, but kept the lessons learned in the token
pairing algorithm.</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="secondattempt"/>Second Attempt</text:h>
<text:p text:style-name="Standard">I tried again this past Fall. This time, I approached the problem with lots
of reading. <text:span text:style-name="MMD-Italic">Lots and lots</text:span> of reading – tons of websites, computer science
journal articles, PhD theses, etc. Learned a lot about lexers, and a lot
about parsers, including hand-crafting vs using parser generators. In brief:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">I learned about the <text:a xlink:type="simple" xlink:href="https://en.wikipedia.org/wiki/Aho-Corasick_algorithm">Aho–Corasick algorithm</text:a>, which is a great way to
efficiently search a string for multiple target strings at once. I used this
to create a custom lexer to identify tokens in a MultiMarkdown text document
(e.g. <text:span text:style-name="Source_20_Text">*</text:span>, <text:span text:style-name="Source_20_Text">[</text:span>, <text:span text:style-name="Source_20_Text">{++</text:span>, etc.). I learned a lot, and had a good time working
out the implementation. This code efficiently allowed me to break a string of
text into the tokens that mattered for Markdown parsing.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">However, in a few instances I really needed some features of regular
expressions to simplify more complex structures. After a quick bit of testing,
using re2c to create a tokenizer was just as efficient, and allowed me to
incorporate some regex functionality that simplified later parsing. I’ll keep
the Aho-Corasick stuff around, and will probably experiment more with it
later. But I didn’t need it for MMD now. <text:span text:style-name="Source_20_Text">lexer.re</text:span> contains the source for
the tokenizer.</text:p></text:list-item>
</text:list>
<text:p text:style-name="Standard">I looked long and hard for a way to simplify the parsing algorithm to try and
“touch” each token only once. Ideally, the program could step through each
token, and decide when to create a new block, when to pair things together,
etc. But I’m not convinced it’s possible. Since Markdown’s grammar varies
based on context, it seems to work best when handled in distinct phases:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="Standard">Tokenize the string to identify key sections of text. This includes line
breaks, allowing the text to be examined one line at time.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">Join series of lines together into blocks, such as paragraphs, code blocks,
lists, etc.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">The tokens inside each block can then be paired together to create more
complex syntax such as links, strong, emphasis, etc.</text:p></text:list-item>
</text:list>
<text:p text:style-name="Standard">To handle the block parsing, I started off using the Aho-Corasick code to
handle my first attempt. I had actually implemented some basic regex
functionality, and used that to group lines together to create blocks. But
this quickly fell apart in the face of more complex structures such as
recursive lists. After a lot of searching, and <text:span text:style-name="MMD-Italic">tons</text:span> more reading, I
ultimately decided to use a parser generator to handle the task of group lines
into blocks. <text:span text:style-name="Source_20_Text">parser.y</text:span> has the source for this, and it is processed by the
<text:a xlink:type="simple" xlink:href="http://www.hwaci.com/sw/lemon/">lemon</text:a> parser generator to create the actual code.</text:p>
<text:p text:style-name="Standard">I chose to do this because hand-crafting the block parser would be complex.
The end result would likely be difficult to read and understand, which would
make it difficult to update later on. Using the parser generator allows me to
write things out in a way that can more easily be understood by a person. In
all likelihood, the performance is probably as good as anything I could do
anyway, if not better.</text:p>
<text:p text:style-name="Standard">Because lemon is a LALR(1) parser, it does require a bit of thinking ahead
about how to create the grammar used. But so far, it has been able to handle
everything I have thrown at it.</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="optimization"/>Optimization</text:h>
<text:p text:style-name="Standard">One of my goals for MMD 6 was performance. So I’ve paid attention to speed
along the way, and have tried to use a few tricks to keep things fast. Here
are some things I’ve learned along the way. In no particular order:</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="memoryallocation"/>Memory Allocation</text:h>
<text:p text:style-name="Standard">When parsing a long document, a <text:span text:style-name="MMD-Italic">lot</text:span> of token structures are created. Each
one requires a small bit of memory to be allocated. In aggregate, that time
added up and slowed down performance.</text:p>
<text:p text:style-name="Standard">After reading for a bit, I ended up coming up with an approach that uses
larger chunks of memory. I allocate pools of of memory in large slabs for
smaller "objects. For example, I allocate memory for 1024 tokens at a
single time, and then dole that memory out as needed. When the slab is empty,
a new one is allocated. This dramatically improved performance.</text:p>
<text:p text:style-name="Standard">When pairing tokens, I created a new stack for each block. I realized that an
empty stack didn’t have any “leftover” cruft to interfere with re-use, so I
just used one for the entire document. Again a sizeable improvement in
performance from only allocating one object instead of many. When recursing
to a deeper level, the stack just gets deeper, but earlier levels aren’t
modified.</text:p>
<text:p text:style-name="Standard">Speaking of tokens, I realized that the average document contains a lot of
single spaces (there’s one between every two words I have written, for
example.) The vast majority of the time, these single spaces have no effect
on the output of Markdown documents. I changed my whitespace token search to
only flag runs of 2 or more spaces, dramatically reducing the number of
tokens. This gives the benefit of needing fewer memory allocations, and also
reduces the number of tokens that need to be processed later on. The only
downside is remember to check for a single space character in a few instances
where it matters.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="properinputbuffering"/>Proper input buffering</text:h>
<text:p text:style-name="Standard">When I first began last spring, I was amazed to see how much time was being
spent by MultiMarkdown simply reading the input file. Then I discovered it
was because I was reading it one character at a time. I switched to using a
buffered read approach and the time to read the file went to almost nothing. I
experimented with different buffer sizes, but they did not seem to make a
measurable difference.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="outputbuffering"/>Output Buffering</text:h>
<text:p text:style-name="Standard">I experimented with different approaches to creating the output after parsing.
I tried printing directly to <text:span text:style-name="Source_20_Text">stdout</text:span>, and even played with different
buffering settings. None of those seemed to work well, and all were slower
than using the <text:span text:style-name="Source_20_Text">d_string</text:span> approach (formerly called <text:span text:style-name="Source_20_Text">GString</text:span> in MMD 5).</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="fastsearches"/>Fast Searches</text:h>
<text:p text:style-name="Standard">After getting basic Markdown functionality complete, I discovered during
testing that the time required to parse a document grew exponentially as the
document grew longer. Performance was on par with CommonMark for shorter
documents, but fell increasingly behind in larger tests. Time profiling found
that the culprit was searching for link definitions when they didn’t exist.
My first approach was to keep a stack of used link definitions, and to iterate
through them when necessary. In long documents, this performs very poorly.
More research and I ended up using
<text:a xlink:type="simple" xlink:href="http://troydhanson.github.io/uthash/">uthash</text:a>. This allows me to search for
a link (or footnote, etc.) by “name” rather than searching through an array.
This allowed me to get MMD’s performance back to O(n), taking roughly twice as
much time to process a document that is twice as long.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="efficientutilityfunctions"/>Efficient Utility Functions</text:h>
<text:p text:style-name="Standard">It is frequently necessary when parsing Markdown to check what sort of
character we are dealing with at a certain position – a letter, whitespace,
punctuation, etc. I created a lookup table for this via <text:span text:style-name="Source_20_Text">char_lookup.c</text:span> and
hard-coded it in <text:span text:style-name="Source_20_Text">char.c</text:span>. These routines allow me to quickly, and
consistently, classify any byte within a document. This saved a lot of
programming time, and saved time tracking down bugs from handling things
slightly differently under different circumstances. I also suspect it
improved performance, but don’t have the data to back it up.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="testingwhilewriting"/>Testing While Writing</text:h>
<text:p text:style-name="Standard">I developed several chunks of code in parallel while creating MMD 6. The vast
majority of it was developed largely in a <text:a xlink:type="simple" xlink:href="https://en.wikipedia.org/wiki/Test-driven_development">test-driven development</text:a> approach.
The other code was largely created with extensive unit testing to accomplish
this.</text:p>
<text:p text:style-name="Standard">MMD isn’t particularly amenable to this approach at the small level, but
instead I relied more on integration testing with an ever-growing collection
of text files and the corresponding HTML files in the MMD 6 test suite. This
allowed me to ensure new features work properly and that old features aren’t
broken. At this time, there are 29 text files in the test suite, and many
more to come.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="otherlessons"/>Other Lessons</text:h>
<text:p text:style-name="Standard">Some things that didn’t do me any good….</text:p>
<text:p text:style-name="Standard">I considered differences between using <text:span text:style-name="Source_20_Text">malloc</text:span> and <text:span text:style-name="Source_20_Text">calloc</text:span> when initializing
tokens. The time saved by using <text:span text:style-name="Source_20_Text">malloc</text:span> was basically exactly offset by the
initial time required to initialize the token to default null values as
compared to using <text:span text:style-name="Source_20_Text">calloc</text:span>. When trying <text:span text:style-name="Source_20_Text">calloc</text:span> failed to help me out
(thinking that clearing a single slab in the object pool would be faster), I
stuck with <text:span text:style-name="Source_20_Text">malloc</text:span> as it makes more sense to me in my workflow.</text:p>
<text:p text:style-name="Standard">I read a bit about <text:a xlink:type="simple" xlink:href="http://www.catb.org/esr/structure-packing/">struct padding</text:a> and reordered some of my structs. It was
until later that I discovered the <text:span text:style-name="Source_20_Text">-Wpadded</text:span> option, and it’s not clear
whether my changes modified anything. Since the structs were being padded
automatically, there was no noticeable performance change, and I didn’t have
the tools to measure whether I could have improved memory usage at all. Not
sure this would be worth the effort – much lower hanging fruit available.</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="performance"/>Performance</text:h>
<text:p text:style-name="Standard">Basic tests show that currently MMD 6 takes about 20–25% longer the CommonMark
0.27.0 to process long files (e.g. 0.2 MB). However, it is around 5% <text:span text:style-name="MMD-Italic">faster</text:span>
than CommonMark when parsing a shorter file (27 kB) (measured by parsing the
same file 200 times over). This test suite is performed by using the Markdown
[syntax page], modified to avoid the use of the Setext header at the top. The
longer files tested are created by copying the same syntax page onto itself,
thereby doubling the length of the file with each iteration.</text:p>
<text:p text:style-name="Standard">The largest file I test is approximately 108 MB (4096 copies of the syntax
page). On my machine (2012 Mac mini with 2.3 GHz Intel Core i7, 16 GB RAM),
it takes approximately 4.4 seconds to parse with MMD 6 and 3.7 seconds with
CommonMark. MMD 6 processes approximately 25 MB/s on this test file.
CommonMark 0.27.0 gets about 29 MB/s on the same machine.</text:p>
<text:p text:style-name="Standard">There are some slight variations with the smaller test files (8–32 copies),
but overall the performance of both programs (MMD 6 and CommonMark) are
roughly linear as the test file gets bigger (double the file size and it takes
twice as long to parse, aka O(n)).</text:p>
<text:p text:style-name="Standard">Out of curiosity, I ran the same tests on the original Markdown.pl by Gruber
(v 1.0.2b8). It took approximately 178 seconds to parse 128 copies of the
file (3.4 MB) and was demonstrating quadratic performance characteristics
(double the file size and it takes 2<text:span text:style-name="MMD-Superscript">2</text:span> or 4 times longer to process, aka
O(n<text:span text:style-name="MMD-Superscript">2</text:span>)). I didn’t bother running it on larger versions of the test file. For
comparison, MMD 6 can process 128 copies in approximately 140 msec.</text:p>
<text:p text:style-name="Standard">Of note, the throughput speed drops when testing more complicated files
containing more advanced MultiMarkdown features, though it still seems to
maintain linear performance characteristics. A second test file is created by
concatenating all of the test suite files (including the Markdown syntax
file). In this case, MMD gets about 13 MB/s. CommonMark doesn’t support
these additional features, so testing it with that file is not relevant. I
will work to see whether there are certain features in particular that are
more challenging and see whether they can be reworked to improve performance.</text:p>
<text:p text:style-name="Standard">As above, I have done some high level optimization of the parse strategy, but
I’m sure there’s still a lot of room for further improvement to be made.
Suggestions welcome!</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="testing"/>Testing</text:h>
<text:h text:outline-level="4"><text:bookmark text:name="testsuite"/>Test Suite</text:h>
<text:p text:style-name="Standard">The development of MMD v6 was heavily, but not absolutely, influenced by the
philosophy of test-driven development. While coding, I made use of test
suites to verify successful implementation of new features, to avoid
regression problems when adding new features, and to identify known edge cases
in need of proper handling.</text:p>
<text:p text:style-name="Standard">The test suite (located in <text:span text:style-name="Source_20_Text">tests/MMD6Tests</text:span>) is a “living” collection of
documents that will continue to be updated as new bugs and edge cases are
identified. This helps make proper integration testing of the entire
application with every release.</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="fuzztesting"/>Fuzz Testing</text:h>
<text:p text:style-name="Standard">I was not familiar with the concept of
<text:a xlink:type="simple" xlink:href="https://en.wikipedia.org/wiki/Fuzzing">Fuzz Testing</text:a> until a user mentioned
something about it to me a year or two ago. I had never used it before, but
it seemed like a good idea. I implemented it in two ways.</text:p>
<text:p text:style-name="Standard">The first is that I created a simplified version of the line parser that
simply accepts various combinations of line type identifiers to see if they
would successfully parse. The line parser is responsible for taking a series
of line types (e.g. plain text, indented line, etc.) and determining what sort
of block they should become. The file <text:span text:style-name="Source_20_Text">test/parser_text.y</text:span> is run through the
<text:span text:style-name="Source_20_Text">lemon</text:span> program, compiled (with or without the <text:span text:style-name="Source_20_Text">-DNDEBUG</text:span> flag) and then run.
It sequentially throws every combination of line types at the simplified line
parser to make sure that it doesn’t choke. When I first did this, I found
several combinations of lines that did not pass.</text:p>
<text:p text:style-name="Standard"><text:span text:style-name="MMD-Bold">NOTE</text:span>: This does not verify accurate parsing, simply that the parser does
not crash by an unacceptable combination of lines.</text:p>
<text:p text:style-name="Standard">The second form of fuzz testing I started using later. This is using the
<text:a xlink:type="simple" xlink:href="http://lcamtuf.coredump.cx/afl/">American fuzzy lop</text:a> program to try to find
text input that crashes MMD. This works by taking sample input (e.g. files
from the test suite), modifying them slightly, and trying the modified
versions. Do this over and over and over, and some interesting edge cases are
sometimes identified. I have found some interesting edge cases this way.
Definitely a useful tool!</text:p>
<text:h text:outline-level="4"><text:bookmark text:name="unittesting"/>Unit Testing</text:h>
<text:p text:style-name="Standard">Some of the original development was done with unit testing in some other
tools I developed. This code formed the basis of a few parts of MMD.
Otherwise, it was hard to see how to really create very good unit tests for
the development of MMD. So there is really not much unit testing built into
the code or used during the development.</text:p>
<text:h text:outline-level="3"><text:bookmark text:name="dependencieslibraries"/>Dependencies/Libraries</text:h>
<text:p text:style-name="Standard">MMD v6 has no external dependencies when compiling, aside from the standard
libraries for C development (Except that it will use <text:span text:style-name="Source_20_Text">libcurl</text:span> if available in
order to support downloading remote images/files for EPUB/FODT exporting.</text:p>
<text:p text:style-name="Standard">MMD can be compiled without any other tools beside the build system (cmake).</text:p>
<text:p text:style-name="Standard">If you want to edit the block parser, you need to modify the <text:span text:style-name="Source_20_Text">parser.y</text:span> file
and process that using <text:a xlink:type="simple" xlink:href="http://www.hwaci.com/sw/lemon/">lemon</text:a> in order to update the <text:span text:style-name="Source_20_Text">parser.c</text:span> file. The
lemon parser source is actually included in MMD and needs to be compiled to be
used.</text:p>
<text:p text:style-name="Standard">If you want to update the lexer or scanner utility functions, then you can
modify <text:span text:style-name="Source_20_Text">lexer.re</text:span> or <text:span text:style-name="Source_20_Text">scanners.re</text:span>. These need to be processed using <text:a xlink:type="simple" xlink:href="http://re2c.org/">re2c</text:a>,
which has to be installed separately.</text:p>
<text:p text:style-name="Standard">MMD v6 makes use of several other projects to improve performance and ease of
use:</text:p>
<text:list text:style-name="L1">
<text:list-item>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="https://troydhanson.github.io/uthash/">uthash</text:a> – provides support for hashes to quickly locate specific “objects”
based on text keys. These are used for matching footnotes, links, images and
the like when created with the reference syntax. Much faster than searching
through each one sequentially.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="https://github.com/richgel999/miniz">miniz</text:a> – provides zip archive support to enable creation of EPUB 3 files,
which are zip files with a specific file structure inside them.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="https://github.com/argtable/argtable3">argtable3</text:a> – provides more advanced command-line argument processing in a
more cross-platform approach than that used by MMD v5.</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="https://curl.haxx.se/libcurl/">libCurl</text:a> – allows for easily downloading image assets from web servers in
order to embed them in packaged file formats, e.g. EPUB 3,
TextBundle/TextPack, OpenDocument, etc.</text:p></text:list-item>
</text:list>
<text:h text:outline-level="3"><text:bookmark text:name="changelog"/>Changelog</text:h>
<text:list text:style-name="L1">
<text:list-item>
<text:p text:style-name="Standard">2023–06–10 - v 6.7.0:</text:p>
<text:list text:style-name="L1">
<text:list-item>
<text:p text:style-name="P1">
ADDED: Add OBJECT_REPLACEMENT_CHARACTER token (fixes #216)</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
ADDED: Add compiler flag (DISABLE_OBJECT_POOL) to disable token pools</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
ADDED: Add more token types</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Add Swift support</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Avoid space to be eaten aways after a slash in latex export</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
CHANGED: Add additional TOC tests</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
CHANGED: Astyle</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
CHANGED: Reformat comment</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Centralize html fix</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Don’t output empty figure captions</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix Glossaries test</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix ambidextrous tokens inside of footnotes and other definitions</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix architecture issue when running multimarkdown from Xcode</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix edge case where table separator without leading pipe is treated as a list item</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix error detecting tables when indented in list items – Thanks, @wnm3!</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix flow control error</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix issue with certain nested lists</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix issue with escaping in URLs</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix issue with reference links with leading space instead of tab</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix regression from pull request that breaks build</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix style issue with ODT output format</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix trailing whitespace issues in headers/TOC</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix typo in xml.c</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Fix typos in error messages</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Improve README install path</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Improve edge cases around fenced code blocks and setext headers</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Improve markup handling around definition lists and colons</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Improve token mapping in header blocks</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Left out file</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Re-enable token object pools in default configuration</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Reset stack sizes before freeing temporary engine</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Restore prior label_counter after {{TOC}}</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Updated argtable3 now needs to link to math</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Use MultiMarkdown instead of libMultiMarkdown as title in version.h</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: Use UTC for timestamp</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
FIXED: bibtex metadata should be raw</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge branch ‘develop’ of github.com:fletcher/MultiMarkdown-6 into develop</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge branch ‘release/6.6.0’ into develop</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge pull request #210 from DivineDominion/swift-framework</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge pull request #233 from DivineDominion/patch-4</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge pull request #243 from alexban011/githubCi</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
Merge pull request #245 from hvellyr/develop</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Apply astyle to all files</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Include definition list colons as markup token</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Project clean up</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Update CMakeLists.txt for Universal Binary</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Update astyle config</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Update github CI for multiple platforms</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Update lexers with newer version of re2c</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: Update to latest argtable3 code</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
UPDATED: standardize common source files</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
ci: added github CI</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="P1">
specify unsigned short for functions in token.h</text:p></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">use unsigned short in implementation, too</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">2020–10–28 - v 6.6.0:</text:p>
<text:list text:style-name="L1">
<text:list-item>
<text:p text:style-name="Standard">UPDATED: Restructure source code organization; Restructure Cmake configuration file; restructure Makefile</text:p></text:list-item>
</text:list></text:list-item>
<text:list-item>
<text:p text:style-name="Standard">2020–10–28 - v 6.5.3:</text:p>
<text:list text:style-name="L1">
<text:list-item>