aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-04-05 08:49:03 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-04-05 08:49:03 -0700
commit65a9d3a8786c23f79de9dcdf56ab7efb789726ff (patch)
tree1474f615cd801a80049919d8533b8f24c322b271
parent08598dedb1d83736b8e0c2d23577ceb2cdc431f5 (diff)
downloadpandoc-65a9d3a8786c23f79de9dcdf56ab7efb789726ff.tar.gz
SelfContained: use application/octet-stream for unknown mime types...
instead of halting with an error. Closes #7202.
-rw-r--r--src/Text/Pandoc/SelfContained.hs9
1 files 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