I wand to remove all HTML tag to reformat document ...
Tidy can not make the job...
I test QString::remove & QRegExp line 10 and line 11 remove the close tag .. now i wand to remove the open tag i tested line 13 but .. remove all..
How can i make this?...
{
qDebug() << "### start clean tag ";
body.replace("<br>","##break##");
body.replace("</br>","##break##");
body.replace("</p>","##break##");
body.replace("</td>","##break##");
body.
remove(QRegExp("<head>(.*)</head>"));
body.
remove(QRegExp("<form(.*)</form>"));
body.
remove(QRegExp("</(div|span|tr|td|br|body|html|tt|a|strong|p)>"));
body.
remove(QRegExp("</(DIV|SPAN|TR|TD|BR|BODY|HTML|TT|A|STRONG|P)>"));
/*body.remove(QRegExp("<(div|span|tr|td|br|body|html|tt|a|strong|p)>"));*/
/*body.remove(QRegExp("<(div|span|tr|td|br|body|html|tt|a|strong|p)( )(.*)(!>)>"));*/
qDebug() << "### newbody " << body;
return body;
}
QString QLess::CleanTag( QString body )
{
qDebug() << "### start clean tag ";
body.replace("<br>","##break##");
body.replace("</br>","##break##");
body.replace("</p>","##break##");
body.replace("</td>","##break##");
body.remove(QRegExp("<head>(.*)</head>"));
body.remove(QRegExp("<form(.*)</form>"));
body.remove(QRegExp("</(div|span|tr|td|br|body|html|tt|a|strong|p)>"));
body.remove(QRegExp("</(DIV|SPAN|TR|TD|BR|BODY|HTML|TT|A|STRONG|P)>"));
/*body.remove(QRegExp("<(div|span|tr|td|br|body|html|tt|a|strong|p)>"));*/
/*body.remove(QRegExp("<(div|span|tr|td|br|body|html|tt|a|strong|p)( )(.*)(!>)>"));*/
qDebug() << "### newbody " << body;
return body;
}
To copy to clipboard, switch view to plain text mode
Bookmarks