@@ -91,14 +91,14 @@ isTextFormat :: String -> Bool
91isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","epub3"]
91isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","epub3"]
93externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc
93externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc
94−externalFilter f args' d = E.handle filterException $
94+externalFilter f args' d = do
95+ (exitcode, outbs, errbs) <- E.handle filterException $
95− do (exitcode, outbs, errbs) <- pipeProcess Nothing f args' $ encode d
96+ pipeProcess Nothing f args' $ encode d
96 when (not $ B.null errbs) $ B.hPutStr stderr errbs
97 when (not $ B.null errbs) $ B.hPutStr stderr errbs
97 case exitcode of
98 case exitcode of
98 ExitSuccess -> return $ either error id $ eitherDecode' outbs
99 ExitSuccess -> return $ either error id $ eitherDecode' outbs
99− ExitFailure _ -> err 83 $ "Error running filter " ++ f ++ "\n" ++
100+ ExitFailure _ -> err 83 $ "Error running filter " ++ f
100− UTF8.toStringLazy outbs
101− where filterException :: E.SomeException -> IO Pandoc
101+ where filterException :: E.SomeException -> IO a
102 filterException e = err 83 $ "Error running filter " ++ f ++
102 filterException e = err 83 $ "Error running filter " ++ f ++
103 "\n" ++ show e
103 "\n" ++ show e