)" )
+ .arg( LangCoder::intToCode2( activeDict->getLangFrom() ),
+ LangCoder::intToCode2( activeDict->getLangTo() ),
+ collapse ? "none" : "inline",
+ dictId.c_str() )
+ .toStdString();
if( errorString.size() ) {
head += "
"
diff --git a/bgl.cc b/bgl.cc
index 4c50c147..b51f753b 100644
--- a/bgl.cc
+++ b/bgl.cc
@@ -848,10 +848,7 @@ void BglArticleRequest::run()
multimap< wstring, pair< string, string > >::const_iterator i;
- string cleaner = """"""""""""
- """"""""""""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
for( i = mainArticles.begin(); i != mainArticles.end(); ++i )
{
if (dict.isFromLanguageRTL() ) // RTL support
diff --git a/mdx.cc b/mdx.cc
index 03cae762..233c193c 100644
--- a/mdx.cc
+++ b/mdx.cc
@@ -664,11 +664,7 @@ void MdxArticleRequest::run()
}
// See Issue #271: A mechanism to clean-up invalid HTML cards.
- string cleaner = """"""""""""
- """"""""""""
- ""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
articleText += "
" + articleBody + cleaner + "
\n";
}
diff --git a/slob.cc b/slob.cc
index 3f46ba27..3df4a370 100644
--- a/slob.cc
+++ b/slob.cc
@@ -801,11 +801,7 @@ void SlobDictionary::loadArticle( quint32 address,
articleText = QObject::tr( "Article decoding error" ).toStdString();
// See Issue #271: A mechanism to clean-up invalid HTML cards.
- string cleaner = """"""""""""
- """"""""""""
- ""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
string prefix( " >::const_iterator i;
- string cleaner = """"""""""""
- """"""""""""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
for( i = mainArticles.begin(); i != mainArticles.end(); ++i )
{
diff --git a/utils.cc b/utils.cc
index 5d565ff1..6b2b9589 100644
--- a/utils.cc
+++ b/utils.cc
@@ -32,3 +32,11 @@ void Utils::Widget::setNoResultColor(QWidget * widget, bool noResult)
widget->setPalette( pal );
}
}
+
+std::string Utils::Html::getHtmlCleaner()
+{
+ return R"(
+
+
+ )";
+}
diff --git a/utils.hh b/utils.hh
index 5d322f36..6907d5d2 100644
--- a/utils.hh
+++ b/utils.hh
@@ -319,6 +319,11 @@ namespace Widget{
void setNoResultColor(QWidget * widget, bool noResult);
}
+namespace Html {
+// See Issue #271: A mechanism to clean-up invalid HTML cards.
+std::string getHtmlCleaner();
+}
+
}
#endif // UTILS_HH
diff --git a/website.cc b/website.cc
index bb2f933e..190ae3dc 100644
--- a/website.cc
+++ b/website.cc
@@ -275,11 +275,7 @@ void WebSiteArticleRequest::requestFinished( QNetworkReply * r )
}
// See Issue #271: A mechanism to clean-up invalid HTML cards.
- articleString += """"""""""""
- """"""""""""
- ""
- ""
- "";
+ articleString += QString::fromStdString(Utils::Html::getHtmlCleaner());
QByteArray articleBody = articleString.toUtf8();
diff --git a/xdxf.cc b/xdxf.cc
index 01e9169f..ea884366 100644
--- a/xdxf.cc
+++ b/xdxf.cc
@@ -596,10 +596,7 @@ void XdxfArticleRequest::run()
multimap< wstring, pair< string, string > >::const_iterator i;
- string cleaner = """"""""""""
- """"""""""""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
for( i = mainArticles.begin(); i != mainArticles.end(); ++i )
{
diff --git a/zim.cc b/zim.cc
index 58f827f8..85241c58 100644
--- a/zim.cc
+++ b/zim.cc
@@ -1382,11 +1382,7 @@ void ZimArticleRequest::run()
string result;
// See Issue #271: A mechanism to clean-up invalid HTML cards.
- string cleaner = """"""""""""
- """"""""""""
- ""
- ""
- "";
+ string cleaner = Utils::Html::getHtmlCleaner();
multimap< wstring, pair< string, string > >::const_iterator i;