diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-09-16 20:32:42 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-09-16 20:40:32 -0700 |
commit | 44e4f7b29278897814f1b1913d3d9a863d9070f8 (patch) | |
tree | 13b6c0e2c22f04f5acde56772e4d95ee0a4d043c | |
parent | 47034fd7810890ebaa0d3ece05e1c50131ffd0a6 (diff) | |
download | pandoc-44e4f7b29278897814f1b1913d3d9a863d9070f8.tar.gz |
Markdown reader: example_lists should work without startnum.
Closes #4908.
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 4 | ||||
-rw-r--r-- | test/command/4908.md | 16 |
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 +``` |