From 26954341132fcc2b9b0e0746a198b5023ed908ee Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Thu, 13 Dec 2012 19:01:01 -0800
Subject: [PATCH] Fixed bug in withRaw.

Didn't correctly handle case where nothing is parsed.
---
 src/Text/Pandoc/Parsing.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)