EPUB
An open e-book standard format that is structured as a ZIP archive containing XHTML content files. Metadata, resource manifests, and reading order are defined by the Open Packaging Format (OPF) specification. EPUB is widely adopted for e-book distribution and reading across devices.
Timeline (last 90 days)
尽可能保留原始DOM,哪怕删除空span都可能破坏布局;尽早规划内联标签的处理,剥离标签只是临时方案。
野外大量EPUB格式不合法,团队实现回退策略:先尝试严格XML解析,失败则用lxml.html解析器。
团队用50本以上不同来源的书做回归测试。
lxml可能把<p></p>变成<p/>,部分阅读器会因此出错,团队最终改用更宽容的HTML解析器来处理许多并非严格合法XML的EPUB。
固定版式EPUB(每页是图片的固定布局书籍)无法用文本方案处理,需要检测并回退到OCR或类PDF流程,目前仍是开放问题。
When processing Markdown or EPUB-format e-books, it is necessary to first perform structured parsing and remove non-readable content such as Markdown heading symbols, footnote markers, and image links, otherwise problems such as reading heading symbols aloud and footnotes being mixed into the body text will occur.
The pragmatic approach for handling corrupted chapters is to skip them and continue rather than letting the entire book conversion fail, in order to be more robust against real-world data
EPUB content files are strict XML rather than lenient HTML; a stray entity or unclosed tag can crash a strict XML parser
An EPUB is essentially a ZIP archive filled with XHTML files
The alphabetical order of EPUB filenames has no relationship to the reading order of the book
6 more timeline events
All Facts (16)
尽可能保留原始DOM,哪怕删除空span都可能破坏布局;尽早规划内联标签的处理,剥离标签只是临时方案。
50%Unverified野外大量EPUB格式不合法,团队实现回退策略:先尝试严格XML解析,失败则用lxml.html解析器。
50%Unverified团队用50本以上不同来源的书做回归测试。
50%Unverifiedlxml可能把<p></p>变成<p/>,部分阅读器会因此出错,团队最终改用更宽容的HTML解析器来处理许多并非严格合法XML的EPUB。
50%Unverified固定版式EPUB(每页是图片的固定布局书籍)无法用文本方案处理,需要检测并回退到OCR或类PDF流程,目前仍是开放问题。
50%UnverifiedWhen processing Markdown or EPUB-format e-books, it is necessary to first perform structured parsing and remove non-readable content such as Markdown heading symbols, footnote markers, and image links, otherwise problems such as reading heading symbols aloud and footnotes being mixed into the body text will occur.
50%UnverifiedThe pragmatic approach for handling corrupted chapters is to skip them and continue rather than letting the entire book conversion fail, in order to be more robust against real-world data
50%UnverifiedEPUB content files are strict XML rather than lenient HTML; a stray entity or unclosed tag can crash a strict XML parser
50%UnverifiedAn EPUB is essentially a ZIP archive filled with XHTML files
50%UnverifiedThe alphabetical order of EPUB filenames has no relationship to the reading order of the book
50%UnverifiedThe true reading order of an EPUB is defined in the package document content.opf
50%UnverifiedOPF (Open Packaging Format) is a core component of the EPUB specification; it is essentially an XML file, typically named content.opf but not required to be
50%UnverifiedThe correct parsing process is: read container.xml to locate the OPF, parse the manifest to build an id-to-href mapping, then traverse and convert in the itemref declaration order of the spine
50%UnverifiedPDF was released by Adobe in 1993 and uses a fixed layout; EPUB was developed by the International Digital Publishing Forum and is a reflowable format that automatically adjusts typesetting based on screen size.
50%UnverifiedEPUB 是由国际数字出版论坛(IDPF,现并入 W3C)制定的开放标准,是目前最被广泛支持的非专有电子书格式
50%UnverifiedAmazon's Send to Kindle service discontinued support for the MOBI format in 2022, fully transitioning to EPUB and PDF.
50%