aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-31 17:34:06 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-31 17:34:06 +0000
commit0b6dc98a0aba0e76567744c00ed6840215ca5d9d (patch)
tree1bda74f4387401311e0382eff48955b33c7ec424 /src/Text/Pandoc/Readers
parent83cddbc68233ea0efe71a036c88bfb2b4a3cfe6b (diff)
downloadpandoc-0b6dc98a0aba0e76567744c00ed6840215ca5d9d.tar.gz
Changed Markdown reader so that the first pass, in which a list
of reference keys is made, is much faster. This gets us a big performance boost. git-svn-id: https://pandoc.googlecode.com/svn/trunk@353 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 585f813d7..4d49e1f28 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -163,7 +163,8 @@ parseMarkdown = do
(title, author, date) <- option ([],[],"") titleBlock
oldState <- getState
oldInput <- getInput
- parseBlocks -- go through once just to get list of reference keys
+ -- go through once just to get list of reference keys
+ manyTill (referenceKey <|> (do{anyLine; return Null})) eof
newState <- getState
let keysUsed = stateKeysUsed newState
setInput oldInput
@@ -492,7 +493,7 @@ rawHtmlBlocks = try (do
--
referenceKey = try (do
- skipSpaces
+ skipNonindentSpaces
label <- reference
char labelSep
skipSpaces