From ed0548d8983d0e2a3bd50602d166837b13e31a85 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 14 Jul 2019 10:48:38 -0700 Subject: Change formatForFilePaths to return a Maybe. Internal change. This will make it easier to emit messages when we're guessing at a format. --- src/Text/Pandoc/App/OutputSettings.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/App/OutputSettings.hs') diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index 837636503..a9034d6f2 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -71,7 +71,8 @@ optToOutputSettings opts = do then liftIO $ pdfWriterAndProg (optWriter opts) (optPdfEngine opts) else case optWriter opts of Nothing -> - return (formatFromFilePaths "html" [outputFile], Nothing) + return (fromMaybe "html" $ formatFromFilePaths [outputFile], + Nothing) Just f -> return (f, Nothing) let format = if ".lua" `isSuffixOf` writerName -- cgit v1.2.3