diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-06-19 09:22:34 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-06-19 09:22:57 -0700 |
commit | e3b8b89d31b848fa9f2539506b3260e5237fd8f2 (patch) | |
tree | 5c489b7ff894d6d2d6b518c0c6b13806279ec14e /src | |
parent | f2c3335642a194773d38409678e49852156865a8 (diff) | |
download | pandoc-e3b8b89d31b848fa9f2539506b3260e5237fd8f2.tar.gz |
Markdown reader: Check for blank lines first in blocks.
(And skip them. This might speed things up in some cases.)
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 3ecc760ae..35c236041 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -359,7 +359,8 @@ parseBlocks :: MarkdownParser (F Blocks) parseBlocks = mconcat <$> manyTill block eof block :: MarkdownParser (F Blocks) -block = choice [ codeBlockFenced +block = choice [ mempty <$ blanklines + , codeBlockFenced , guardEnabled Ext_latex_macros *> (macro >>= return . return) , header , lhsCodeBlock @@ -376,7 +377,6 @@ block = choice [ codeBlockFenced , noteBlock , referenceKey , abbrevKey - , mempty <$ blanklines , para , plain ] <?> "block" |