Originally Posted by
jacek
Then you should better try your code on:
[html]text1
<form>form1</form>
text2
<form>form2</form>
text3[/html]
hint
Now take moore as on form and java scripts or style...
Run so...
{
qDebug() << "### start clean tag "; /* */
body.replace(" "," ");
body.replace("<br>","##break##");
body.replace("</br>","##break##");
body.replace("</p>","##break##");
body.replace("</td>","##break##");
body.
remove(QRegExp("<head>(.*)</head>",Qt
::CaseInsensitive));
body.
remove(QRegExp("<form(.)[^>]*</form>",Qt
::CaseInsensitive));
body.
remove(QRegExp("<script(.)[^>]*</script>",Qt
::CaseInsensitive));
body.
remove(QRegExp("<style(.)[^>]*</style>",Qt
::CaseInsensitive));
body.
remove(QRegExp("<(.)[^>]*>"));
body.replace("##break##","</br>");
qDebug() << "### newbody " << body;
return body;
}
QString QLess::CleanTag( QString body )
{
qDebug() << "### start clean tag "; /* */
body.replace(" "," ");
body.replace("<br>","##break##");
body.replace("</br>","##break##");
body.replace("</p>","##break##");
body.replace("</td>","##break##");
body.remove(QRegExp("<head>(.*)</head>",Qt::CaseInsensitive));
body.remove(QRegExp("<form(.)[^>]*</form>",Qt::CaseInsensitive));
body.remove(QRegExp("<script(.)[^>]*</script>",Qt::CaseInsensitive));
body.remove(QRegExp("<style(.)[^>]*</style>",Qt::CaseInsensitive));
body.remove(QRegExp("<(.)[^>]*>"));
body.replace("##break##","</br>");
qDebug() << "### newbody " << body;
return body;
}
To copy to clipboard, switch view to plain text mode
html result:
text1
text2
text3
text1
text2
text3
To copy to clipboard, switch view to plain text mode
Bookmarks