-
-
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
Inline images lost when conversion from ePub to HTML #10395
Comments
Seems that the problem is not with the transformation, but with the parsing itself.
|
Not surprising, but worth commenting: I see the same behaviour when seeing the AST generated for an (X)HTML document:
generates a similar AST node:
|
That's right. We just extract text from |
I think this can be closed as out of scope. |
I think the root issue is the mapping AFAIK, there is no HTML tag that only accepts text, so I see assumptions need to be done during conversion. The only solution I can think of is updating the mapping to |
Pandoc conversions are often lossy, and that's okay given that different formats don't match precisely. E.g., if you're converting an HTML code block to markdown, you're not going to be able to put emphasis inside it, and generally the desirable behavior is to just leave that out. If we used a Div, we'd get output that wasn't a code block, which is undesirable. |
Explain the problem.
I am converting an ePub file to HTML (for later conversion to PDF).
The command line is simple:
pandoc file.epub --from=epub --to=html -o file.html
The ePub file is generated from AsciiDoc (via AsciiDoctor-epub3), and include an inline image (to be precise, a callout).
Exploding the ePub file, the offending portion is (redacted for clarity):
The HTML resulting from the conversion is missing the image:
As per my (very light) investigation, it seems that
img
tags insidepre
are not retained, evenimg
is a valid child forpre
.Pandoc version?
pandoc 3.5
Features: +server +lua
Scripting engine: Lua 5.4
OS: Linux (Fedora 40)
The text was updated successfully, but these errors were encountered: