Skip to content
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

Converting Epub with noteref to any format drops <a ... epub:type="noteref"> in result #7884

Closed
Aspvik opened this issue Feb 2, 2022 · 8 comments
Labels

Comments

@Aspvik
Copy link

Aspvik commented Feb 2, 2022

Explain the problem.
When I convert any epub3 file with footnotes <a ... epub:type="noteref"> to html, pdf or docx the entire <a> element is removed from the body in the resulting file. The actual note itself at the end of the document is present. If I remove the epub:type="noteref"attribute before converting it comes through.

pandoc -o org.html -s -f epub org.epub

FYI: The document starts out as a docx, then we store them as epub internally, and offer pdf exports. So the source epub file is also generated by Pandoc.

Pandoc version?
pandoc 2.17.1.1
Compiled with pandoc-types 1.22.1, texmath 0.12.4, skylighting 0.12.2,
citeproc 0.6.0.1, ipynb 0.2

@Aspvik Aspvik added the bug label Feb 2, 2022
@jgm
Copy link
Owner

jgm commented Feb 2, 2022

See #5531.
Can you upload a minimal example we can test with?

@Aspvik
Copy link
Author

Aspvik commented Feb 3, 2022

Original: example.docx

pandoc -o example.epub example.docx
example.epub: EPUB/text/ch00N.xhtml footnotes/note are present.

pandoc -o example.html -s -f epub example.epub
index.html: <a> tag's are missing

I had to zip the example files because of unsupported file formats.
Examples.zip

jgm added a commit that referenced this issue Feb 7, 2022
when parsing `<a epub:type="noteref">` and the identifier
doesn't correspond to anything in the note table.

Previously we just silently skipped these cases.

See #7884.
@jgm
Copy link
Owner

jgm commented Feb 7, 2022

OK, I see the problem now and have a path to fixing it.

@Aspvik
Copy link
Author

Aspvik commented Feb 8, 2022

Excellent. I built from source now and the issue is resolved. When do you expect this fix to be released?

@jgm
Copy link
Owner

jgm commented Feb 8, 2022

Really? It's not resolved in my tests.
The change I pushed only adds some warnings.

@Aspvik
Copy link
Author

Aspvik commented Feb 8, 2022

I could see the warnings while converting. Still the <a> tag is present in the final html output.

There is however a new block at the end which does not seem complete footnotes-end-of-document
example2.html.txt

I omitted the -s for simplicity, but the result is the same.

@jgm
Copy link
Owner

jgm commented Feb 8, 2022

The problem is that we aren't finding the id in the note table.
Previously we just passed over this without notice. With the change above, we emit a warning and an empty note. So, you'll see the <a> tag but it will link to a blank note. This is because I still haven't fixed the root problem.

@jgm jgm closed this as completed in 7a888e8 Feb 9, 2022
@jgm
Copy link
Owner

jgm commented Feb 9, 2022

I can't tell you when the next release will be. For now you can use a nightly.

jgm added a commit that referenced this issue Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants