git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: Use extensible exceptions.
commite6a03cdd4bd36cb3baceb226125b89a422ab0a09 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 3 Mar 2012, 08:16 (15 years ago) parent8a218dc
1 file changed+3−1
src/Text/Pandoc/Writers/EPUB.hs+3−1
src/Text/Pandoc/Writers/EPUB.hs+3−1
@@ -48,6 +48,8 @@ import Text.Pandoc.Writers.Markdown ( writePlain )
4848import Data.Char ( toLower )
4949import Network.URI ( unEscapeString )
5050import Text.Pandoc.MIME (getMimeType)
51+import Prelude hiding (catch)
52+import Control.Exception (catch, SomeException)
5153
5254-- | Produce an EPUB file from a Pandoc document.
5355writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line
@@ -127,7 +129,7 @@ writeEPUB mbStylesheet fonts opts doc@(Pandoc meta _) = do
127129
128130 -- contents.opf
129131 localeLang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG")
130− (\_ -> return "en-US")
132+ (\e -> let _ = (e :: SomeException) in return "en-US")
131133 let lang = case lookup "lang" (writerVariables opts') of
132134 Just x -> x
133135 Nothing -> localeLang