From 65a9d3a8786c23f79de9dcdf56ab7efb789726ff Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Mon, 5 Apr 2021 08:49:03 -0700 Subject: [PATCH] SelfContained: use application/octet-stream for unknown mime types... instead of halting with an error. Closes #7202. --- src/Text/Pandoc/SelfContained.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs index c9e20cad0..17c1e18c9 100644 --- a/src/Text/Pandoc/SelfContained.hs +++ b/src/Text/Pandoc/SelfContained.hs @@ -244,11 +244,10 @@ getData mimetype src let raw' = if ext `elem` [".gz", ".svgz"] then B.concat $ L.toChunks $ Gzip.decompress $ L.fromChunks [raw] else raw - mime <- case (mimetype, respMime) of - ("",Nothing) -> throwError $ PandocSomeError - $ "Could not determine mime type for `" <> src <> "'" - (x, Nothing) -> return x - (_, Just x ) -> return x + let mime = case (mimetype, respMime) of + ("",Nothing) -> "application/octet-stream" + (x, Nothing) -> x + (_, Just x ) -> x result <- if "text/css" `T.isPrefixOf` mime then do oldInputs <- getInputFiles