aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-04-30 00:54:56 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-04-30 00:55:25 +0300
commit3d766b5c442fc9ff198fe2d3978418343e0bd12f (patch)
tree3077b9dab4618a0214ec5a77593efc0419367f8d
parentd250eed455e7c3b0669d64c064c29c3598d3120b (diff)
downloadpandoc-3d766b5c442fc9ff198fe2d3978418343e0bd12f.tar.gz
Don't lowercase custom writer filename
Fixes #4610
-rw-r--r--src/Text/Pandoc/App.hs8
1 files changed, 3 insertions, 5 deletions
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")
""