Loading src/encode.h +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ namespace libhtmlpp { {"<","<"}, {">",">"}, {"'","'"}, {"+","+"}, {nullptr,nullptr} }; }; src/html.cpp +31 −15 Original line number Diff line number Diff line Loading @@ -494,9 +494,8 @@ void libhtmlpp::HtmlString::_buildTree() { } ++ii; } }else if( (ii+3) < _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ }else if( (ii + 9) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ size_t start = ii; while(ii < _Data.size()){ if(_Data[ii] == HTMLTAG_CLOSE) { addelement(&lastEl); Loading @@ -512,18 +511,35 @@ void libhtmlpp::HtmlString::_buildTree() { ++ii; } if (ii == _Data.size()) { throw excp[HTMLException::Error] << "Parsing error: Unclosed <textarea tag."; } size_t close = ++ii; size_t lvl = 0; while(ii < _Data.size()){ if( std::equal(_Data.begin()+ii,_Data.begin()+(ii+10),"</textarea")) { if( (ii + 9) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ ++lvl; } if( (ii + 10) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+10),"</textarea")) { if(lvl == 0){ std::copy(_Data.begin() + close, _Data.begin() + ii, std::back_inserter(static_cast<TextArea*>(lastEl->element.get())->_Text)); ii += 10; break; }else{ --lvl; } } ++ii; } if (ii == _Data.size()) { throw excp[HTMLException::Error] << "Parsing error: Missing </textarea closing tag."; } }else { size_t start=ii; addelement(&lastEl); Loading Loading
src/encode.h +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ namespace libhtmlpp { {"<","<"}, {">",">"}, {"'","'"}, {"+","+"}, {nullptr,nullptr} }; };
src/html.cpp +31 −15 Original line number Diff line number Diff line Loading @@ -494,9 +494,8 @@ void libhtmlpp::HtmlString::_buildTree() { } ++ii; } }else if( (ii+3) < _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ }else if( (ii + 9) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ size_t start = ii; while(ii < _Data.size()){ if(_Data[ii] == HTMLTAG_CLOSE) { addelement(&lastEl); Loading @@ -512,18 +511,35 @@ void libhtmlpp::HtmlString::_buildTree() { ++ii; } if (ii == _Data.size()) { throw excp[HTMLException::Error] << "Parsing error: Unclosed <textarea tag."; } size_t close = ++ii; size_t lvl = 0; while(ii < _Data.size()){ if( std::equal(_Data.begin()+ii,_Data.begin()+(ii+10),"</textarea")) { if( (ii + 9) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+9),"<textarea")){ ++lvl; } if( (ii + 10) <= _Data.size() && std::equal(_Data.begin()+ii,_Data.begin()+(ii+10),"</textarea")) { if(lvl == 0){ std::copy(_Data.begin() + close, _Data.begin() + ii, std::back_inserter(static_cast<TextArea*>(lastEl->element.get())->_Text)); ii += 10; break; }else{ --lvl; } } ++ii; } if (ii == _Data.size()) { throw excp[HTMLException::Error] << "Parsing error: Missing </textarea closing tag."; } }else { size_t start=ii; addelement(&lastEl); Loading