aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-09-16 20:32:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-09-16 20:40:32 -0700
commit44e4f7b29278897814f1b1913d3d9a863d9070f8 (patch)
tree13b6c0e2c22f04f5acde56772e4d95ee0a4d043c
parent47034fd7810890ebaa0d3ece05e1c50131ffd0a6 (diff)
downloadpandoc-44e4f7b29278897814f1b1913d3d9a863d9070f8.tar.gz
Markdown reader: example_lists should work without startnum.
Closes #4908.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
-rw-r--r--test/command/4908.md16
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 502abae9a..5f6788887 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -970,7 +970,9 @@ orderedList = try $ do
<|> return (style == Example)
items <- fmap sequence $ many1 $ listItem fourSpaceRule
(orderedListStart (Just (style, delim)))
- start' <- (start <$ guardEnabled Ext_startnum) <|> return 1
+ start' <- if style == Example
+ then return start
+ else (start <$ guardEnabled Ext_startnum) <|> return 1
return $ B.orderedListWith (start', style, delim) <$> fmap compactify items
bulletList :: PandocMonad m => MarkdownParser m (F Blocks)
diff --git a/test/command/4908.md b/test/command/4908.md
new file mode 100644
index 000000000..2ff1a4603
--- /dev/null
+++ b/test/command/4908.md
@@ -0,0 +1,16 @@
+```
+% pandoc -f markdown_mmd+fancy_lists+example_lists -t native -t plain
+(@) Example one
+(@) Example two
+
+some text
+
+(@) Example three
+^D
+(1) Example one
+(2) Example two
+
+some text
+
+(3) Example three
+```