Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13650 +/- ##
==========================================
- Coverage 46.93% 46.75% -0.18%
==========================================
Files 45 44 -1
Lines 9891 10005 +114
Branches 112 112
==========================================
+ Hits 4642 4678 +36
- Misses 5231 5309 +78
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds EPUB ingestion support to the parsing pipeline by introducing a dedicated DeepDoc EPUB parser and wiring it into both the “naive” chunking path and the flow Parser component.
Changes:
- Introduce
RAGFlowEpubParserto extract XHTML content from EPUBs (spine-ordered, with a fallback scan) and chunk via the existing HTML parser. - Register EPUB as a supported type in the flow parser (
rag/flow/parser/parser.py) and naive chunker (rag/app/naive.py), and exposeEpubParserfromdeepdoc.parser. - Extend file type detection to recognize
.epub, and add unit tests for EPUB parsing behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
deepdoc/parser/epub_parser.py |
New EPUB parser implementation (spine ordering + fallback). |
deepdoc/parser/__init__.py |
Exports EpubParser from the parser package. |
rag/flow/parser/parser.py |
Adds EPUB support to flow parser configuration and invocation map. |
rag/app/naive.py |
Adds .epub handling branch in chunk() and imports EpubParser. |
api/utils/file_utils.py |
Recognizes .epub in filename_type() extension matching. |
test/unit_test/deepdoc/parser/test_epub_parser.py |
Adds unit tests covering EPUB parsing, ordering, and fallbacks. |
You can also share your feedback on Copilot code review. Take the survey.
5429e70 to
0bfbcbb
Compare
yongtenglei
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1398
What problem does this PR solve?
Adds native support for EPUB files. EPUB content is extracted in spine (reading) order and parsed using the existing HTML parser. No new dependencies required.
Type of change
To check this parser manually: