git.iko.soy/typeable/pandoc
on master help sign in
Use lookAhead instead of getInput/setInput in RST reader.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@537 788f1e2b-df1e-0410-8736-df70ead52e1b

commit9ad7c73b577fa2286084c559f5dba670f93ae24e authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 15 Feb 2007, 01:33 (20 years ago) parentd3efa4a
1 file changed+1−3
src/Text/Pandoc/Readers/RST.hs+1−3
src/Text/Pandoc/Readers/RST.hs+1−3
@@ -101,13 +101,11 @@ titleTransform blocks = (blocks, [])
101101
102102parseRST = do
103103 state <- getState
104− input <- getInput
105104 -- first pass: get anonymous keys
106− keyBlocks <- manyTill (anonymousKey <|> (do{anyLine; return Null})) eof
105+ keyBlocks <- lookAhead $ manyTill (anonymousKey <|> (do{anyLine; return Null})) eof
107106 let anonymousKeys = filter (/= Null) keyBlocks
108107 -- run parser again to fill in anonymous links...
109108 setState (state { stateKeyBlocks = anonymousKeys })
110− setInput input
111109 blocks <- parseBlocks
112110 let blocks' = filter isNotAnonKeyBlock blocks
113111 let (blocks'', title) = if stateStandalone state