ePub exports using old ePub format and have errors

This template is for bug report only:

  • Lettera Version: 1.0.0 (4458)
  • macOS Version: 27.0.1
  • What were you doing: importing an ePub file into Apple Books
  • What feature did you use: exported my MD into a ePub format
  • What happened: ePub export has errors in it that make it unable to be imported into Apple Books
  • What did you expect to happen: that the ePub export would be 100% compatible with Apple Books

I’m not sure if this is new in MacOS 27 and I no longer have a MacOS 26 to test with but apparently you’re exporting to epub v2.0 format and in some ePub files there are errors that prevent Books from loading.

I used the ACE app from Daisy (same makers of epubcheck) and it provided a detailed report of the errors it encountered even for ePub v2.0.

For some reasons, some of my ePub files imported successfully even with a number of errors. The error counts range from 56 (on the imported file) to 75 on the file that failed to import.

A quick review of the reports show that most of the errors have to do with Image syntax and a few EPUB metadata issues.

Apple supports both ePub v2.0 & v3.0 and is compatible with the latest ePub version 3.2. It seems to work with some v2.0 files but not all. I could try and find out the delta between the two reports to zero in on which error is preventing it from loading but I’m going to assume you’ll want to fix them all and upgrade to ePub format v3.2.

I know the exports are not on the top of your list. Let me know if you want me to send you the reports but I’m assuming you can test and verify this with your own test cases. I’d be happy to send you the reports and the ePub files if you’d like when ready.

Let me know what you prefer.

thanks -tom

Do you mind sharing an MD file reporting this issue?
We currently export ePub 2.0 to maximize compatibility with old devices/OSes. I don’t think it’s unreasonable to support version 3.0 but I’d prefer checking if this is a bug first.

ok, that makes sense.

I tried uploading a zip with the MD folders + assets as many of the errors are related to image syntax and without them you may not get the same errors.

The zip included the ePub, MD+assets, and the ACE reports but it’s over 100mb; so, unable to upload. Let me know if you have another option for sending large files or I can email it to you.

For now, if it helps, here’s the MD file that creates the ePub that fails to load. The ePub is too large as well to upload.

Ch19 - Woodpeckers.md (58.8 KB)

thanks -tom

Update: attached is the raw html report file. It’s readable just missing their (ACE) formatting but you can at least see the errors listed.

report.html.zip (14.6 KB)

I wouldn’t assume EPUB 2.0 itself is the problem here, especially if some of the exported files still open correctly in Apple Books.

It might be worth separating validation errors from the ones that actually prevent import. For example, a broken image reference, an incorrect media type in the manifest, or a missing resource could affect the EPUB regardless of whether it’s version 2 or 3.

Since the Markdown file and ACE report are available now, comparing the reported image paths against the actual entries inside the EPUB archive might be a useful first check. Case sensitivity and URL-encoded filenames could be worth looking at too.

I’d probably fix the packaging issues first, then consider EPUB 3 support as a separate compatibility improvement. Otherwise a format upgrade might just carry the same underlying errors into a newer container.

Thank you, I’ll take a look. Much appreciated.

Depending on the issue, I may not be able to fix it by changing the source as it may be during the export process but I’ll get to it over the next few days.

Update:

I’m seeing the same issues in both ACE reports, one that loaded into Apple Books and one that didn’t. There are a few issues in the EPUB & WCAG 2.0A rulesets. Some are labeled “serious” and “moderate”. The majority have to do with image syntax.

I used a browser based tool to add a Cover photo and some additional metadata. It’s simply HTML & Javascript running locally, no server-side uploads or processing. After making a couple of small edits to the metadata, the resulting ePub loaded into Apple Books just fine.

No idea what went wrong with the export but whatever it was this tool fixed it and the ACE report didn’t change.

A future ePub export feature could include adding a cover photo and extra metadata, which would be helpful compared to adding another step; however, this depends on whether Lettera aims to serve as an editor, publisher, or something else. Adding too many features risks creating an overbuilt application, and we should avoid that. I have noticed that current exports render better than many Markdown tools, such as Marked—which fails for me because I center images—so I would prefer using another tool to fill gaps rather than losing the export feature entirely.

The link to the tool I used is below.

-tom