Commit 75afa222 authored by jan.koester's avatar jan.koester
Browse files

test

parent 514a01c5
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ void libhtmlpp::HtmlString::_buildTree() {
                        addelement(&lastEl);
                        lastEl->element=std::make_unique<CommentElement>();
                        std::copy(_Data.begin()+start,_Data.begin()+ii,
                                  std::back_inserter(((CommentElement*)lastEl->element.get())->_Comment));
                                  std::back_inserter(static_cast<CommentElement*>(lastEl->element.get())->_Comment));
                        ii+=3;
                        break;
                    }
@@ -441,7 +441,7 @@ void libhtmlpp::HtmlString::_buildTree() {

                        std::copy(_Data.begin()+start,_Data.begin()+ii,std::back_inserter(tel));

                        _serialelize(tel,(SvgElement*)lastEl->element.get());
                        _serialelize(tel,static_cast<SvgElement*>(lastEl->element.get()));

                        break;
                    }
@@ -454,7 +454,7 @@ void libhtmlpp::HtmlString::_buildTree() {
                    if( std::equal(_Data.begin()+ii,_Data.begin()+(ii+8),"</script")) {

                        std::copy(_Data.begin()+close,_Data.begin()+ii,
                                  std::back_inserter(((ScriptElement*)lastEl->element.get())->_Script));
                                  std::back_inserter(static_cast<ScriptElement*>(lastEl->element.get())->_Script));
                        ii+=8;
                        break;
                    }
@@ -484,7 +484,7 @@ void libhtmlpp::HtmlString::_buildTree() {
                    if( std::equal(_Data.begin()+ii,_Data.begin()+(ii+5),"</svg")) {

                        std::copy(_Data.begin()+close,_Data.begin()+ii,
                                  std::back_inserter(((SvgElement*)lastEl->element.get())->_Svg));
                                  std::back_inserter(static_cast<SvgElement*>(lastEl->element.get())->_Svg));
                        ii+=5;
                        break;
                    }
@@ -501,7 +501,7 @@ void libhtmlpp::HtmlString::_buildTree() {
                    }else if(_Data[ii]==HTMLTAG_CLOSE) {
                        std::vector<char> tel;
                        std::copy(_Data.begin()+start,_Data.begin()+ii,std::back_inserter(tel));
                        _serialelize(tel,(HtmlElement*)lastEl->element.get());
                        _serialelize(tel,static_cast<HtmlElement*>(lastEl->element.get()));
                        break;
                    }
                    if(_Data[ii]!=' ' && _Data[ii]!=HTMLTAG_OPEN){
@@ -519,7 +519,7 @@ void libhtmlpp::HtmlString::_buildTree() {
                        if(!buf.empty()){
                            addelement(&lastEl);
                            lastEl->element=std::make_unique<TextElement>();
                            std::copy(buf.begin(),buf.end(),std::back_inserter(((TextElement*)(lastEl->element.get()))->_Text));
                            std::copy(buf.begin(),buf.end(),std::back_inserter((static_cast<TextElement*>(lastEl->element.get()))->_Text));

                        }
                        goto BUILDTREE_STARTLOOP;
@@ -1444,8 +1444,8 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated)
    switch(el->getType()){
        case HtmlEl:{
            output.append("<");
            output.append(reinterpret_cast<const HtmlElement*>(el)->getTagname());
            for (HtmlElement::Attributes* curattr = reinterpret_cast<const HtmlElement*>(el)->_firstAttr.get(); curattr; curattr = curattr->_nextAttr.get()) {
            output.append(static_cast<const HtmlElement*>(el)->getTagname());
            for (HtmlElement::Attributes* curattr = static_cast<const HtmlElement*>(el)->_firstAttr.get(); curattr; curattr = curattr->_nextAttr.get()) {
                output.append(" ");
                std::copy(
                    curattr->_Key.begin(),
@@ -1470,21 +1470,21 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated)
                virgin=false;
            }

            if (reinterpret_cast<const HtmlElement*>(el)->_childElement) {
            if (static_cast<const HtmlElement*>(el)->_childElement) {
                if(formated)
                    output.append("\r\n");
                cpylist.push(el);
                el=reinterpret_cast<const HtmlElement*>(el)->_childElement.get();
                el=static_cast<const HtmlElement*>(el)->_childElement.get();
                ++lvl;
                goto PRINTNEXTEL;
            }

            //Container must be always terminated fuck html5
            if(isContainer(reinterpret_cast<const HtmlElement*>(el)->getTagname())){
            if(isContainer(static_cast<const HtmlElement*>(el)->getTagname())){
                output.append("</");
                std::copy(
                    reinterpret_cast<const HtmlElement*>(el)->_TagName.begin(),
                          reinterpret_cast<const HtmlElement*>(el)->_TagName.end(),
                    static_cast<const HtmlElement*>(el)->_TagName.begin(),
                          static_cast<const HtmlElement*>(el)->_TagName.end(),
                          std::back_inserter(output)
                );
                output.append(">");