jgm/commonmark-hs

Improve architecture for FormattingSpecs

Opened this issue · 0 comments

jgm commented

Instead of a list of [FormattingSpec], let's have a FormattingSpecMap.
Define Monoid for this so that if you have two formatting specs for the same character, one a single-matcher and the other a double-matcher, the right thing happens.
See #87 for motivation.
Currently we build the FormattingSpecMap properly in Inlines, but it might be more efficient just to make this the data structure defined in the syntax.