diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-04-25 21:52:27 -0400 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-04-25 21:56:26 -0400 |
commit | 66dd2008b060d285d5e07ace8a89b17c63132022 (patch) | |
tree | 428521220a0c4df94e1345bd31c1c792039cc195 /src/Text/Pandoc | |
parent | d88a601642c30b954bbc057892a359447d0cef4f (diff) | |
download | pandoc-66dd2008b060d285d5e07ace8a89b17c63132022.tar.gz |
Fix --self-contained so it works when output format has extensions.
Previously if you used `--self-contained` with `html-smart` or
`html+smart`, it wouldn't work.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/App.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index fe3f37db8..aabefc64a 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -241,13 +241,13 @@ convertWithOpts opts = do "all" -> id "none" -> (filterIpynbOutput Nothing :) "best" -> (filterIpynbOutput (Just $ - if htmlFormat writerName + if htmlFormat format then Format "html" else - case writerName of + case format of "latex" -> Format "latex" "beamer" -> Format "latex" - _ -> Format writerName) :) + _ -> Format format) :) _ -> id) -- should not happen $ [] @@ -299,7 +299,7 @@ convertWithOpts opts = do else (<> T.singleton '\n') output <- addNl <$> f writerOptions doc writerFn eol outputFile =<< - if optSelfContained opts && htmlFormat writerName + if optSelfContained opts && htmlFormat format -- TODO not maximally efficient; change type -- of makeSelfContained so it works w/ Text then T.pack <$> makeSelfContained (T.unpack output) |