git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.Parsing: Change parseFromString to fail if not all input is

consumed.

commit58e4e4a608de489f993c36234048014d93b39116 authorMatthew Pickering <matthewtpickering@gmail.com> dateThu 11 Dec 2014, 19:14 (12 years ago) parenta5cac0a
1 file changed+3−1
src/Text/Pandoc/Parsing.hs+3−1
src/Text/Pandoc/Parsing.hs+3−1
@@ -314,12 +314,14 @@ stringAnyCase (x:xs) = do
314314 return (firstChar:rest)
315315
316316-- | Parse contents of 'str' using 'parser' and return result.
317−parseFromString :: Stream s m t => ParserT s st m a -> s -> ParserT s st m a
317+parseFromString :: Monad m => ParserT String st m a -> String -> ParserT String st m a
318318parseFromString parser str = do
319319 oldPos <- getPosition
320320 oldInput <- getInput
321321 setInput str
322322 result <- parser
323+ spaces
324+ eof
323325 setInput oldInput
324326 setPosition oldPos
325327 return result