aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2024-06-08 17:40:42 +0200
committerGitHub <[email protected]>2024-06-08 08:40:42 -0700
commit11a2f78cda7550b40ee097e169e6794d690e07b4 (patch)
tree715f9fdd1e9536143165bb5248b98dfe5124e1f4
parent7db19d8cd4906c19ea36484202133137d87c1985 (diff)
PandocMonad: convert IOErrors to warnings when fetching absolute paths (#9859)
-rw-r--r--src/Text/Pandoc/Class/PandocMonad.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs
index 412696e96..fdec5616d 100644
--- a/src/Text/Pandoc/Class/PandocMonad.hs
+++ b/src/Text/Pandoc/Class/PandocMonad.hs
@@ -467,6 +467,11 @@ fillMediaBag d = walkM handleImage d
return $ Image attr lab (src, tit))
(\e ->
case e of
+ PandocIOError text err -> do
+ report $ CouldNotFetchResource text . T.pack $
+ (show err ++ "\nReplacing image with description.")
+ -- emit alt text
+ return $ replacementSpan attr src tit lab
PandocResourceNotFound _ -> do
report $ CouldNotFetchResource src
"replacing image with description"