From 0ee12ba687584a0a95e2110b9a2f191f34b41627 Mon Sep 17 00:00:00 2001 From: draekko Date: Wed, 9 Nov 2022 19:48:27 -0500 Subject: [PATCH] Adds support for epubs that return text/html instead of application/xhtml+xml --- crengine/src/epubfmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crengine/src/epubfmt.cpp b/crengine/src/epubfmt.cpp index a983bf51b..388bae2ab 100644 --- a/crengine/src/epubfmt.cpp +++ b/crengine/src/epubfmt.cpp @@ -1344,7 +1344,7 @@ bool ImportEpubDocument( LVStreamRef stream, ldomDocument * m_doc, LVDocViewCall int fragmentCount = 0; size_t spineItemsNb = spineItems.length(); for ( size_t i=0; imediaType == "application/xhtml+xml") { + if (spineItems[i]->mediaType == "application/xhtml+xml" || spineItems[i]->mediaType == "text/html") { lString32 name = LVCombinePaths(codeBase, spineItems[i]->href); lString32 subst = cs32("_doc_fragment_") + fmt::decimal(i); appender.addPathSubstitution( name, subst ); @@ -1360,7 +1360,7 @@ bool ImportEpubDocument( LVStreamRef stream, ldomDocument * m_doc, LVDocViewCall lastProgressPercent = percent; } } - if (spineItems[i]->mediaType == "application/xhtml+xml") { + if (spineItems[i]->mediaType == "application/xhtml+xml" || spineItems[i]->mediaType == "text/html") { lString32 name = LVCombinePaths(codeBase, spineItems[i]->href); { CRLog::debug("Checking fragment: %s", LCSTR(name));