@@ -112,8 +112,9 @@ parseOptions options' defaults = do
112 let (actions, args, unrecognizedOpts, errors) =
112 let (actions, args, unrecognizedOpts, errors) =
113 getOpt' Permute options' rawArgs
113 getOpt' Permute options' rawArgs
115+ let unknownOptionErrors =
115− let unknownOptionErrors = foldr handleUnrecognizedOption [] $
116+ foldr (handleUnrecognizedOption . (takeWhile (/= '='))) []
116− map (takeWhile (/= '=')) unrecognizedOpts
117+ unrecognizedOpts
118 unless (null errors && null unknownOptionErrors) $
119 unless (null errors && null unknownOptionErrors) $
119 E.throwIO $ PandocOptionError $
120 E.throwIO $ PandocOptionError $
@@ -205,12 +206,10 @@ convertWithOpts opts = do
205 Just _ -> return $ optDataDir opts
206 Just _ -> return $ optDataDir opts
207 -- assign reader and writer based on options and filenames
208 -- assign reader and writer based on options and filenames
208− let readerName = case optReader opts of
209− Nothing -> defaultReaderName
209+ let readerName = fromMaybe ( defaultReaderName
210− (if any isURI sources
210+ (if any isURI sources
211− then "html"
211+ then "html"
212− else "markdown") sources
212+ else "markdown") sources) (optReader opts)
215 let nonPdfWriterName Nothing = defaultWriterName outputFile
214 let nonPdfWriterName Nothing = defaultWriterName outputFile
216 nonPdfWriterName (Just x) = x
215 nonPdfWriterName (Just x) = x
@@ -286,7 +285,7 @@ convertWithOpts opts = do
287 istty <- queryTerminal stdOutput
286 istty <- queryTerminal stdOutput
289− when (not (isTextFormat format) && istty && optOutputFile opts == Nothing) $
288+ when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $
290 E.throwIO $ PandocAppError $
289 E.throwIO $ PandocAppError $
291 "Cannot write " ++ format ++ " output to terminal.\n" ++
290 "Cannot write " ++ format ++ " output to terminal.\n" ++
292 "Specify an output file using the -o option, or " ++
291 "Specify an output file using the -o option, or " ++