From e3b8b89d31b848fa9f2539506b3260e5237fd8f2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 19 Jun 2013 09:22:34 -0700 Subject: Markdown reader: Check for blank lines first in blocks. (And skip them. This might speed things up in some cases.) --- src/Text/Pandoc/Readers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers/Markdown.hs') 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" -- cgit v1.2.3