ZIM/libzim/libkiwix should provide full HTML DOM

This commit is contained in:
Emmanuel Engelhart 2017-05-19 20:37:21 +02:00
parent c2d29376d9
commit af10b665a9

View File

@ -511,10 +511,6 @@ struct MHD_Response* handle_content(struct MHD_Connection * connection,
/* Special rewrite URL in case of ZIM file use intern *asbolute* url like /A/Kiwix */
if (mimeType.find("text/html") != string::npos) {
if (content.find("<body") == std::string::npos &&
content.find("<BODY") == std::string::npos) {
content = "<html><head><title>" + article.getTitle() + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>" + content + "</body></html>";
}
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
content = replaceRegex(content, "$1$2" + humanReadableBookId + "/$3/",
"(href|src)(=[\"|\']{0,1}/)([A-Z|\\-])/");