git.iko.soy/typeable/pandoc
on master help sign in
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.

commit66dd2008b060d285d5e07ace8a89b17c63132022 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 25 Apr 2019, 21:52 (8 years ago) parentd88a601
1 file changed+4−4
src/Text/Pandoc/App.hs+4−4
src/Text/Pandoc/App.hs+4−4
@@ -241,13 +241,13 @@ convertWithOpts opts = do
241241 "all" -> id
242242 "none" -> (filterIpynbOutput Nothing :)
243243 "best" -> (filterIpynbOutput (Just $
244− if htmlFormat writerName
244+ if htmlFormat format
245245 then Format "html"
246246 else
247− case writerName of
247+ case format of
248248 "latex" -> Format "latex"
249249 "beamer" -> Format "latex"
250− _ -> Format writerName) :)
250+ _ -> Format format) :)
251251 _ -> id) -- should not happen
252252 $ []
253253
@@ -299,7 +299,7 @@ convertWithOpts opts = do
299299 else (<> T.singleton '\n')
300300 output <- addNl <$> f writerOptions doc
301301 writerFn eol outputFile =<<
302− if optSelfContained opts && htmlFormat writerName
302+ if optSelfContained opts && htmlFormat format
303303 -- TODO not maximally efficient; change type
304304 -- of makeSelfContained so it works w/ Text
305305 then T.pack <$> makeSelfContained (T.unpack output)