From 3d766b5c442fc9ff198fe2d3978418343e0bd12f Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Mon, 30 Apr 2018 00:54:56 +0300 Subject: Don't lowercase custom writer filename Fixes #4610 --- src/Text/Pandoc/App.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 9a3e00c9f..abc732213 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -223,17 +223,16 @@ convertWithOpts opts = do then pdfWriterAndProg (optWriter opts) (optPdfEngine opts) else return (nonPdfWriterName $ optWriter opts, Nothing) - let format = baseWriterName + let format = map toLower $ baseWriterName $ takeFileName writerName -- in case path to lua script -- disabling the custom writer for now (writer, writerExts) <- if ".lua" `isSuffixOf` format - -- note: use non-lowercased version writerName then return (TextWriter (\o d -> writeCustom writerName o d) :: Writer PandocIO, mempty) - else case getWriter writerName of + else case getWriter (map toLower writerName) of Left e -> E.throwIO $ PandocAppError $ if format == "pdf" then e ++ @@ -844,8 +843,7 @@ options = , Option "tw" ["to","write"] (ReqArg - (\arg opt -> return opt { optWriter = - Just (map toLower arg) }) + (\arg opt -> return opt { optWriter = Just arg }) "FORMAT") "" -- cgit v1.2.3