Commit d7f38d2a authored by Didier Clerc's avatar Didier Clerc

added missing files

parent 81507a3b
#include <QDebug>
#include "UBTextTools.h"
QString UBTextTools::cleanHtmlCData(const QString &_html){
QString clean = "";
for(int i = 0; i < _html.length(); i+=1){
if(_html.at(i) != '\0')
clean.append(_html.at(i));
}
return clean;
}
QString UBTextTools::cleanHtml(const QString& _html){
const QString START_TAG = "<!doctype";
const QString END_TAG = "</html";
QString cleanSource = "";
QString simplifiedHtml = _html;
int start = simplifiedHtml.toLower().indexOf(START_TAG);
int end = simplifiedHtml.toLower().indexOf(END_TAG) + END_TAG.size();
cleanSource = simplifiedHtml.mid(start, end);
return cleanSource;
}
#ifndef UBTEXTTOOLS_H
#define UBTEXTTOOLS_H
#include <QString>
class UBTextTools{
public:
UBTextTools(){}
virtual ~UBTextTools(){}
static QString cleanHtmlCData(const QString& _html);
static QString cleanHtml(const QString& _html);
};
#endif // UBTEXTTOOLS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment