Commit 7d8f4972 authored by jan.koester's avatar jan.koester
Browse files

fixed

parent d2f2829a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -255,7 +255,6 @@ bool libhtmlpp::HtmlString::validate(std::string &err){
    return false;
}


libhtmlpp::DocElements *libhtmlpp::HtmlString::_buildtreenode(DocElements* prev,libhtmlpp::DocElements* next,libhtmlpp::DocElements* start,libhtmlpp::DocElements* end){
    auto checkterminator = [end](DocElements *termel){
        int i=0;
@@ -267,7 +266,7 @@ libhtmlpp::DocElements *libhtmlpp::HtmlString::_buildtreenode(DocElements* prev,
            }

            if (curcel->element->_Type==HtmlEl && curcel->terminator &&
                ((HtmlElement*)curcel->element)->_TagName == ((HtmlElement*)termel->element)->_TagName) {
                *((HtmlElement*)curcel->element)->_TagName == *((HtmlElement*)termel->element)->_TagName) {
                if(i==0)
                    return curcel;
                else
@@ -963,7 +962,7 @@ void libhtmlpp::HtmlPage::_CheckHeader(const HtmlString &page){
    }
}


#include <iostream>
void libhtmlpp::print(Element* el, std::string *output) {

    std::stack<libhtmlpp::Element*> *cpylist = new std::stack<libhtmlpp::Element*>;
+1 −1
Original line number Diff line number Diff line
@@ -14,4 +14,4 @@ target_link_libraries(htmlcopytest htmlpp)

add_test(htmlcopytest_right htmlcopytest ${CMAKE_SOURCE_DIR}/test/htmlfiles/right.html)

#set_tests_properties(htmlpagetest_wrong PROPERTIES WILL_FAIL TRUE)
set_tests_properties(htmlpagetest_wrong PROPERTIES WILL_FAIL TRUE)
+2 −3
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public:
    void printModify(){
        std::string *html = new std::string;
        libhtmlpp::print(&index2,html);
        std::cout << html << std::endl;
        std::cout << *html << std::endl;
        delete html;
    }

@@ -71,13 +71,12 @@ int main(int arc,char *argv[]){

        std::cout << "Orginal html:" << std::endl;
        libhtmlpp::print(index,html);
        std::cout << *html << std::endl;

        std::cout << "Modified html:" << std::endl;

        cpy.printModify();


        std::cout << html << std::endl;
        std::cout << Green << "Test Passed!" << NOCOLOR << std::endl;
        delete html;
    }catch(libhtmlpp::HTMLException &exp){
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ int main(int arc,char *argv[]){
        libhtmlpp::Element *index=page.loadFile(argv[1]);
        std::string *html = new std::string;
        libhtmlpp::print(index,html);
        std::cout << html << std::endl;
        std::cout << *html << std::endl;
        std::cout << Green << "Test Passed!" << NOCOLOR << std::endl;
        delete html;
    }catch(libhtmlpp::HTMLException &exp){