-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have --self-contained use alt text when images are missing instead of failing #7904
Comments
I'm not sure what the best behavior is. Currently we try to guarantee that a file produced with |
Emitting a warning instead of failing hard seems like a sensible behaviour, considering that's what pdflatex and browsers do as well.
if the image has been deleted (or was at a URL that's a 404 now), then the file cannot be any more self-contained than that, so I'd argue that principle isn't violated. Only thing I can think of that could break with this change is CI scripts that rely on pandoc's non-zero exit code in this case, but that's a very edge case... |
i kind of like the behaviour when using latex as backend: emit a clear warning and produce some valid output using the alt text. |
In the PDF module we use |
@jgm An option |
Sorry my bad, true that exists and I am already using. Sorry. |
Explain the problem.
Not sure if this is actually a bug or an expected behaviour, so sorry if this is not the right place to report.
Starting from a simple test.md file, with a markdown command such as

If the image exists, everything is ok, but if the image does not exist, I have the following behaviours:
--self-contained
option: pandoc returns an missing file error: File ./myimage.png not found in resource path and exits without completing the process using the alternative text (which is the default for html).The same also happens with raw html tags:
<img>
and<embded>
trying to embed a pdf file in the html.It seems to be related to the
--self-contained
option, as removing it actually populate thesrc
attribute in the html tag ignoring the file existence.It may be useful to have pandoc generates the final output with alternative texts – or maybe just completes the generation of the output file with warnings – in contexts where an automation runs a script that involves pandoc and not all assets are already available (es. some appendix as pdf, or some images).
Pandoc version?
pandoc 2.17.1.1 on Docker image pandoc/latex.
The text was updated successfully, but these errors were encountered: