aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2014-12-11 19:14:28 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2014-12-15 21:35:46 +0000
commit58e4e4a608de489f993c36234048014d93b39116 (patch)
tree2cd3e20cf191fe6d0a21cca56f799cfeba37335a /src/Text
parenta5cac0a0c401b0d5c901ac734c877f6a32bddb40 (diff)
downloadpandoc-58e4e4a608de489f993c36234048014d93b39116.tar.gz
Text.Pandoc.Parsing: Change parseFromString to fail if not all input is
consumed.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 18f38e564..28ea2bd2f 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -314,12 +314,14 @@ stringAnyCase (x:xs) = do
return (firstChar:rest)
-- | Parse contents of 'str' using 'parser' and return result.
-parseFromString :: Stream s m t => ParserT s st m a -> s -> ParserT s st m a
+parseFromString :: Monad m => ParserT String st m a -> String -> ParserT String st m a
parseFromString parser str = do
oldPos <- getPosition
oldInput <- getInput
setInput str
result <- parser
+ spaces
+ eof
setInput oldInput
setPosition oldPos
return result