Markdown reader: Check for blank lines first in blocks.

(And skip them.  This might speed things up in some cases.)
This commit is contained in:
John MacFarlane 2013-06-19 09:22:34 -07:00
parent f2c3335642
commit e3b8b89d31

View file

@ -359,7 +359,8 @@ parseBlocks :: MarkdownParser (F Blocks)
parseBlocks = mconcat <$> manyTill block eof parseBlocks = mconcat <$> manyTill block eof
block :: MarkdownParser (F Blocks) block :: MarkdownParser (F Blocks)
block = choice [ codeBlockFenced block = choice [ mempty <$ blanklines
, codeBlockFenced
, guardEnabled Ext_latex_macros *> (macro >>= return . return) , guardEnabled Ext_latex_macros *> (macro >>= return . return)
, header , header
, lhsCodeBlock , lhsCodeBlock
@ -376,7 +377,6 @@ block = choice [ codeBlockFenced
, noteBlock , noteBlock
, referenceKey , referenceKey
, abbrevKey , abbrevKey
, mempty <$ blanklines
, para , para
, plain , plain
] <?> "block" ] <?> "block"