Skip to content

fix(docreader): preserve illustrations before EPUB chapter titles - #6231

Open
lanqing431 wants to merge 1 commit into
Tencent:mainfrom
lanqing431:fix/epub-leading-image-order
Open

lanqing431 wants to merge 1 commit into
Tencent:mainfrom
lanqing431:fix/epub-leading-image-order

Conversation

@lanqing431

Copy link
Copy Markdown

Description

An EPUB chapter can start with an illustration before its first heading. When the chapter has no text before that heading, the parser can lift the heading ahead of the illustration. Treat a preceding body image with a source as chapter content so the conversion keeps the original reading order.

Testing

  • Added a regression with XHTML packaged verbatim in an EPUB. It fails against upstream and passes with this change.
  • All 32 EPUB tests passed. Python compilation and git diff --check passed.
  • The Go DocReader client tests passed against a loopback gRPC server, including the live URL and file tests.
  • Full Python discovery ran 652 tests on Windows. The same 15 failures and 2 errors, and the same 22 skips, were also present on unmodified main in the same environment. They occur in container, LibreOffice/PowerPoint, and image worker coverage. This change adds one passing test.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant