aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 553a93f28..593311b01 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -288,10 +288,12 @@ stringAnyCase (x:xs) = do
-- | Parse contents of 'str' using 'parser' and return result.
parseFromString :: GenParser tok st a -> [tok] -> GenParser tok st a
parseFromString parser str = do
+ oldPos <- getPosition
oldInput <- getInput
setInput str
result <- parser
setInput oldInput
+ setPosition oldPos
return result
-- | Parse raw line block up to and including blank lines.