From 66dd2008b060d285d5e07ace8a89b17c63132022 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 25 Apr 2019 21:52:27 -0400 Subject: 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. --- src/Text/Pandoc/App.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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) -- cgit v1.2.3