aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-12-05 11:26:01 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-12-05 11:26:01 -0800
commit36807db531d1b65a25fee9bf3afd4ece60f12041 (patch)
tree67b39529b06b6586b9a7946a3a015f0a4fe1261a /src
parent51f6f0e3a1533a0e1bb94538f55bdc9db380a028 (diff)
downloadpandoc-36807db531d1b65a25fee9bf3afd4ece60f12041.tar.gz
Commonmark writer: allow ')' delimiters on ordered lists.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 96de5e0cd..022dbc24f 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -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