TOC location fix (#25)
## Summary * Rely on media-type="application/x-dtbncx+xml" to find TOC instead of hardcoded values ## Additional Context * Most of my epubs don't have id==ncx for toc file location. I think this media-type is EPUB standard --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
67da8139b3
commit
973d372521
@@ -73,10 +73,8 @@ bool Epub::parseContentOpf(const std::string& contentOpfFilePath) {
|
||||
coverImageItem = opfParser.items.at(opfParser.coverItemId);
|
||||
}
|
||||
|
||||
if (opfParser.items.count("ncx")) {
|
||||
tocNcxItem = opfParser.items.at("ncx");
|
||||
} else if (opfParser.items.count("ncxtoc")) {
|
||||
tocNcxItem = opfParser.items.at("ncxtoc");
|
||||
if (!opfParser.tocNcxPath.empty()) {
|
||||
tocNcxItem = opfParser.tocNcxPath;
|
||||
}
|
||||
|
||||
for (auto& spineRef : opfParser.spineRefs) {
|
||||
|
||||
Reference in New Issue
Block a user