git.iko.soy/typeable/pandoc
on master help sign in
Fix --self-contained so it works when output format has extensions.
66dd200John MacFarlane
src/Text/Pandoc/App.hs+4−4
@@ -241,13 +241,13 @@ convertWithOpts opts = do
241 "all" -> id
241 "all" -> id
242 "none" -> (filterIpynbOutput Nothing :)
242 "none" -> (filterIpynbOutput Nothing :)
243 "best" -> (filterIpynbOutput (Just $
243 "best" -> (filterIpynbOutput (Just $
244− if htmlFormat writerName
244+ if htmlFormat format
245 then Format "html"
245 then Format "html"
246 else
246 else
247− case writerName of
247+ case format of
248 "latex" -> Format "latex"
248 "latex" -> Format "latex"
249 "beamer" -> Format "latex"
249 "beamer" -> Format "latex"
250− _ -> Format writerName) :)
250+ _ -> Format format) :)
251 _ -> id) -- should not happen
251 _ -> id) -- should not happen
252 $ []
252 $ []
253
253
@@ -299,7 +299,7 @@ convertWithOpts opts = do
299 else (<> T.singleton '\n')
299 else (<> T.singleton '\n')
300 output <- addNl <$> f writerOptions doc
300 output <- addNl <$> f writerOptions doc
301 writerFn eol outputFile =<<
301 writerFn eol outputFile =<<
302− if optSelfContained opts && htmlFormat writerName
302+ if optSelfContained opts && htmlFormat format
303 -- TODO not maximally efficient; change type
303 -- TODO not maximally efficient; change type
304 -- of makeSelfContained so it works w/ Text
304 -- of makeSelfContained so it works w/ Text
305 then T.pack <$> makeSelfContained (T.unpack output)
305 then T.pack <$> makeSelfContained (T.unpack output)