mirror of https://github.com/kiwix/libkiwix.git
+ add a stub HTML header/footer if the content only have the <body>
.--Cette ligne, et les suivantes ci-dessous, seront ignorées-- M reader.cpp
This commit is contained in:
parent
c9a81bf79b
commit
d968ac7114
|
@ -167,6 +167,12 @@ namespace kiwix {
|
|||
/* Get the data */
|
||||
content = string(article.getData().data(), article.getArticleSize());
|
||||
|
||||
/* Try to set a stub HTML header/footer if necesssary */
|
||||
if (contentType == "text/html" && std::string::npos == content.find("<body>")) {
|
||||
cout << content << endl;
|
||||
content = "<html><head><title>" + article.getTitle() + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>" + content + "</body></html>";
|
||||
}
|
||||
|
||||
/* Get the data length */
|
||||
contentLength = article.getArticleSize();
|
||||
|
||||
|
|
Loading…
Reference in New Issue