aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-23 21:07:52 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-23 21:10:33 -0800
commitdd3ec34a3452ebc159ab201c643ad6d4738733ec (patch)
tree633f211aa8861ad4add430971d8606c39890a216 /src/Text
parent59a47454574d9eab424ef3d6d9ef6b238515f479 (diff)
downloadpandoc-dd3ec34a3452ebc159ab201c643ad6d4738733ec.tar.gz
Fixed bug: when target is PDF, writer extensions were being ignored.
E.g. `-t latex-smart -o file.pdf` would produce a different latex intermediate than `-t latex-smart -o file.tex`. Thanks to Bernhard Fisseni for pointing this out. This is a regression since pandoc 2.0 (introduced in commit c7e3c1ec).
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/App.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index df4bdc151..e597c56d6 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -143,7 +143,7 @@ pdfWriterAndProg :: Maybe String -- ^ user-specified writer name
-> IO (String, Maybe String) -- ^ IO (writerName, maybePdfEngineProg)
pdfWriterAndProg mWriter mEngine = do
let panErr msg = liftIO $ E.throwIO $ PandocAppError msg
- case go (baseWriterName <$> mWriter) mEngine of
+ case go mWriter mEngine of
Right (writ, prog) -> return (writ, Just prog)
Left err -> panErr err
where
@@ -151,7 +151,7 @@ pdfWriterAndProg mWriter mEngine = do
go (Just writer) Nothing = (writer,) <$> engineForWriter writer
go Nothing (Just engine) = (,engine) <$> writerForEngine engine
go (Just writer) (Just engine) =
- case find (== (writer, engine)) engines of
+ case find (== (baseWriterName writer, engine)) engines of
Just _ -> Right (writer, engine)
Nothing -> Left $ "pdf-engine " ++ engine ++
" is not compatible with output format " ++ writer
@@ -161,7 +161,7 @@ pdfWriterAndProg mWriter mEngine = do
[] -> Left $
"pdf-engine " ++ eng ++ " not known"
- engineForWriter w = case [e | (f,e) <- engines, f == w] of
+ engineForWriter w = case [e | (f,e) <- engines, f == baseWriterName w] of
eng : _ -> Right eng
[] -> Left $
"cannot produce pdf output from " ++ w