Loading src/exception.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ const char* libhtmlpp::HTMLException::what(){ return msg.c_str(); } libhtmlpp::HTMLException& libhtmlpp::HTMLException::append(const char *src){ libhtmlpp::HTMLException& libhtmlpp::HTMLException::append(const std::string &src){ msg.append(src); return *this; } Loading @@ -62,7 +62,7 @@ libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator[](int errtype){ return *this; } libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(const char *src){ libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(const std::string &src){ return append(src); }; Loading src/exception.h +2 −2 Original line number Diff line number Diff line Loading @@ -57,9 +57,9 @@ namespace libhtmlpp { enum Type {Note,Warning,Error,Critical}; HTMLException& append(const char *src); HTMLException& append(const std::string &src); HTMLException& operator[](int errtype); HTMLException& operator<<(const char *src); HTMLException& operator<<(const std::string &src); HTMLException& operator<<(int src); private: int curCType; Loading src/html.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,15 @@ void libhtmlpp::HtmlString::_buildtreenode(const libhtmlpp::DocElements *firstel if(curcel==end) break; } for(size_t ii=0; ContainerTypes[ii]; ++ii){ if(reinterpret_cast<HtmlElement*>(termel->element)->getTagname()==ContainerTypes[ii]){ HTMLException e; e[HTMLException::Error] << reinterpret_cast<HtmlElement*>(termel->element)->getTagname() << " must be terminated !"; throw e; } } return (const DocElements*) nullptr; }; Loading test/htmlfiles/wrong.html +1 −1 Original line number Diff line number Diff line <!!DOCTYPE html> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> Loading Loading
src/exception.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ const char* libhtmlpp::HTMLException::what(){ return msg.c_str(); } libhtmlpp::HTMLException& libhtmlpp::HTMLException::append(const char *src){ libhtmlpp::HTMLException& libhtmlpp::HTMLException::append(const std::string &src){ msg.append(src); return *this; } Loading @@ -62,7 +62,7 @@ libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator[](int errtype){ return *this; } libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(const char *src){ libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(const std::string &src){ return append(src); }; Loading
src/exception.h +2 −2 Original line number Diff line number Diff line Loading @@ -57,9 +57,9 @@ namespace libhtmlpp { enum Type {Note,Warning,Error,Critical}; HTMLException& append(const char *src); HTMLException& append(const std::string &src); HTMLException& operator[](int errtype); HTMLException& operator<<(const char *src); HTMLException& operator<<(const std::string &src); HTMLException& operator<<(int src); private: int curCType; Loading
src/html.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,15 @@ void libhtmlpp::HtmlString::_buildtreenode(const libhtmlpp::DocElements *firstel if(curcel==end) break; } for(size_t ii=0; ContainerTypes[ii]; ++ii){ if(reinterpret_cast<HtmlElement*>(termel->element)->getTagname()==ContainerTypes[ii]){ HTMLException e; e[HTMLException::Error] << reinterpret_cast<HtmlElement*>(termel->element)->getTagname() << " must be terminated !"; throw e; } } return (const DocElements*) nullptr; }; Loading
test/htmlfiles/wrong.html +1 −1 Original line number Diff line number Diff line <!!DOCTYPE html> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> Loading