Replace unresolvable remote images with their descriptions
max-heller opened this issue · 0 comments
max-heller commented
Mirror Pandoc's behavior of replacing remote images that can't be loaded with their description. We only resolve images that Pandoc can't handle, so if we fail to resolve it, we want to make sure the URL doesn't get to Pandoc, which would try and fail to process it.
This should be implemented here:
mdbook-pandoc/src/preprocess.rs
Lines 226 to 240 in aa239fa
Sample Pandoc log for inspiration:
[WARNING] Could not fetch resource https://img.shields.io/github/actions/workflow/status/google/comprehensive-rust/build.yml?style=flat-square: HttpExceptionRequest Request {
host = "img.shields.io"
port = 443
secure = True
requestHeaders = []
path = "/github/actions/workflow/status/google/comprehensive-rust/build.yml"
queryString = "?style=flat-square"
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
(ConnectionFailure user error (Network.Socket.gai_strerror not supported: 11004))
Replacing image with description.
Identified in google/comprehensive-rust#1911 (comment)