aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/OutputSettings.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-07-14 10:48:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-14 10:48:38 -0700
commited0548d8983d0e2a3bd50602d166837b13e31a85 (patch)
treef8ede30a77b9aa50bb17235537897f72c55dafa2 /src/Text/Pandoc/App/OutputSettings.hs
parent968d2046a3cb6db661673be580660ac402753c34 (diff)
downloadpandoc-ed0548d8983d0e2a3bd50602d166837b13e31a85.tar.gz
Change formatForFilePaths to return a Maybe.
Internal change. This will make it easier to emit messages when we're guessing at a format.
Diffstat (limited to 'src/Text/Pandoc/App/OutputSettings.hs')
-rw-r--r--src/Text/Pandoc/App/OutputSettings.hs3
1 files changed, 2 insertions, 1 deletions
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