diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-02-04 10:05:52 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-02-04 10:05:52 -0800 |
commit | 3127ab2b5ede10224f9f86722125573d34d7d3dd (patch) | |
tree | 641b3034a72c7325f0f2301a2e40335005c72736 /src/Text/Pandoc/Readers | |
parent | 4a84e9691e5a177811b0c8771bc07790e0543e37 (diff) | |
download | pandoc-3127ab2b5ede10224f9f86722125573d34d7d3dd.tar.gz |
Slight code reorganization in endline.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 3feafd362..8a41cef49 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1540,16 +1540,14 @@ endline :: MarkdownParser (F Inlines) endline = try $ do newline notFollowedBy blankline + -- parse potential list-starts differently if in a list: + st <- getState + when (stateParserContext st == ListItemState) $ notFollowedBy listStart guardDisabled Ext_lists_without_preceding_blankline <|> notFollowedBy listStart guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart guardEnabled Ext_blank_before_header <|> notFollowedBy (char '#') -- atx header guardEnabled Ext_backtick_code_blocks >> notFollowedBy (() <$ (lookAhead (char '`') >> codeBlockFenced)) - -- parse potential list-starts differently if in a list: - st <- getState - when (stateParserContext st == ListItemState) $ do - notFollowedBy' bulletListStart - notFollowedBy' anyOrderedListStart (guardEnabled Ext_hard_line_breaks >> return (return B.linebreak)) <|> (guardEnabled Ext_ignore_line_breaks >> return mempty) <|> (return $ return B.space) |