diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-12-13 19:01:01 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-12-13 19:04:01 -0800 |
commit | 26954341132fcc2b9b0e0746a198b5023ed908ee (patch) | |
tree | d77acd5aeb1ebd9e0c8bb261d0be9f4ebb744238 | |
parent | 6e36375bdcf8875091e3716e951ebd5a2efc8f44 (diff) | |
download | pandoc-26954341132fcc2b9b0e0746a198b5023ed908ee.tar.gz |
Fixed bug in withRaw.
Didn't correctly handle case where nothing is parsed.
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 9239ed9a3..777c07b4f 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -412,7 +412,7 @@ withRaw parser = do let (l2,c2) = (sourceLine pos2, sourceColumn pos2) let inplines = take ((l2 - l1) + 1) $ lines inp let raw = case inplines of - [] -> error "raw: inplines is null" -- shouldn't happen + [] -> "" [l] -> take (c2 - c1) l ls -> unlines (init ls) ++ take (c2 - 1) (last ls) return (result, raw) |