diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-11-28 20:21:07 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-11-28 20:21:07 -0800 |
commit | 4c21c5566dbf525a2cf9e1a3c979390109d5f788 (patch) | |
tree | 82eb03ccdccbdf52b44388539a19cb4417ceaa82 /src/Text/Pandoc/Readers | |
parent | 68d38db19468c6a9bb7a4676dd072e7f81f619f2 (diff) | |
parent | 3ffd7246173b8bdc0d25167355f55e3193aaa989 (diff) | |
download | pandoc-4c21c5566dbf525a2cf9e1a3c979390109d5f788.tar.gz |
Merge branch 'master' into citeproc
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index d39050243..b664476b4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -320,6 +320,9 @@ atxClosing = try $ skipMany (char '#') >> blanklines setextHeader :: GenParser Char ParserState Block setextHeader = try $ do + -- This lookahead prevents us from wasting time parsing Inlines + -- unless necessary -- it gives a significant performance boost. + lookAhead $ anyLine >> many1 (oneOf setextHChars) >> blankline text <- many1Till inline newline underlineChar <- oneOf setextHChars many (char underlineChar) |