aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-07-27 15:45:47 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-07-27 15:45:47 -0700
commitb51608299700e7be401d3f85bcdf6b6eb71633e8 (patch)
tree8ec7277c3e75d3a9137dd3ee4c6e93bca9136452 /src/Text/Pandoc/Readers
parent6e548b8a8f00fcb347e5aa5b3b7148b32e50e058 (diff)
downloadpandoc-b51608299700e7be401d3f85bcdf6b6eb71633e8.tar.gz
Markdown reader: Check fancy_lists and startnum extensions.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 8b34b9b4a..7f4ed6d3e 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -44,7 +44,7 @@ import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
isTextTag, isCommentTag )
import Text.Pandoc.XML ( fromEntities )
-import Control.Monad (when, liftM, guard, mzero)
+import Control.Monad (when, liftM, guard, mzero, unless )
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Match (tagOpen)
@@ -592,11 +592,15 @@ listItem start = try $ do
orderedList :: Parser [Char] ParserState Block
orderedList = try $ do
(start, style, delim) <- lookAhead anyOrderedListStart
+ unless ((style == DefaultStyle || style == Decimal) &&
+ (delim == DefaultDelim || delim == Period)) $
+ guardEnabled Ext_fancy_lists
items <- many1 $ listItem $ try $
do optional newline -- if preceded by a Plain block in a list context
skipNonindentSpaces
orderedListMarker style delim
- return $ OrderedList (start, style, delim) $ compactify items
+ start' <- option 1 $ guardEnabled Ext_startnum >> return start
+ return $ OrderedList (start', style, delim) $ compactify items
bulletList :: Parser [Char] ParserState Block
bulletList =