From 44e4f7b29278897814f1b1913d3d9a863d9070f8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 16 Sep 2018 20:32:42 -0700 Subject: Markdown reader: example_lists should work without startnum. Closes #4908. --- src/Text/Pandoc/Readers/Markdown.hs | 4 +++- test/command/4908.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 test/command/4908.md 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 +``` -- cgit v1.2.3