Commonmark writer: allow ')' delimiters on ordered lists.

This commit is contained in:
John MacFarlane 2021-12-05 11:26:01 -08:00
parent 51f6f0e3a1
commit 36807db531

View file

@ -588,7 +588,12 @@ blockToMarkdown' opts (OrderedList (start,sty,delim) items) = do
then start
else 1
let sty' = if isEnabled Ext_fancy_lists opts then sty else DefaultStyle
let delim' = if isEnabled Ext_fancy_lists opts then delim else DefaultDelim
let delim' = if isEnabled Ext_fancy_lists opts
then delim
else if variant == Commonmark &&
(delim == OneParen || delim == TwoParens)
then OneParen -- commonmark only supports one paren
else DefaultDelim
let attribs = (start', sty', delim')
let markers = orderedListMarkers attribs
let markers' = map (\m -> if T.length m < 3