Commit ee6ba674 authored by jan.koester's avatar jan.koester
Browse files

fxied

parent 85d96239
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -484,7 +484,6 @@ BUILDTREE_STARTLOOP:
                switch(_Data[ii]){
                    case HTMLTAG_OPEN: {
                        if(!buf.empty()){
                            std::cout.write(buf.data(),buf.size()) << std::endl;
                            addelement(&firstEl,&lastEl,new TextElement());
                            std::copy(buf.begin(),buf.end(),std::back_inserter(((TextElement*)(lastEl->element))->_Text));
                            goto BUILDTREE_STARTLOOP;
@@ -564,19 +563,15 @@ GETTAGEND:
    for(size_t i=et; i<in.size(); i++){
            bool value=false;
            size_t kstart=std::string::npos,kend=std::string::npos;
            if(in[i]=='>'){
                break;
            }else if(in[i]!=' ' || in[i]!='\r' || in[i]!='\n'){
            if(in[i]!=' ' || in[i]!='\r' || in[i]!='\n'){
                kstart=i;
                kend=in.size();
                size_t vstart=std::string::npos,vend=std::string::npos;
                while(i<in.size()){
                    if (in[i]=='='){
                        value=true;
                        kend=i;
                        break;
                    }else if(in[i] == '>'){
                        kend=i;
                        break;
                    }
                    ++i;
                }
@@ -595,15 +590,14 @@ GETTAGEND:
                    }
                }

                if(kstart != std::string::npos && kend != std::string::npos){
                if(kstart - kend >0){

                    std::string key,val;

                    std::copy(in.begin()+kstart,in.begin()+kend,std::back_inserter(key));

                    if(vend != std::string::npos && vstart!=std::string::npos){
                    if(vend-vstart>0){
                        std::copy(in.begin()+vstart,in.begin()+vend,std::back_inserter(val));
                        std::cerr << val << std::endl;
                    }

                    if(val.empty())
@@ -738,6 +732,9 @@ void libhtmlpp::HtmlElement::insertChild(const libhtmlpp::Element* el){
        case ScriptEL:
            _childElement=new ScriptElement;
            break;
        case SvgEL:
            _childElement=new SvgElement;
            break;
        default:
            HTMLException ex;
            ex[HTMLException::Critical] << "appendChild: Unknown html element found: "<< el->getType() << " !";
@@ -771,6 +768,9 @@ void libhtmlpp::HtmlElement::appendChild(const libhtmlpp::Element* el){
                case ScriptEL:
                    curel=new ScriptElement;
                    break;
               case SvgEL:
                    curel=new SvgElement;
                    break;
                default:
                    HTMLException ex;
                    ex[HTMLException::Critical] << "appendChild: Unknown html element found: "<< el->getType() << " !";
@@ -968,7 +968,7 @@ NEWEL:
                }
            }
            ((ScriptElement*)dest)->_Script=(((ScriptElement*)src)->_Script);
        }else if(src->getType()==libhtmlpp::ScriptEL && dest->getType()== libhtmlpp::SvgEL){
        }else if(src->getType()==libhtmlpp::SvgEL && dest->getType()== libhtmlpp::SvgEL){
            ((libhtmlpp::SvgElement*)dest)->_TagName=(((libhtmlpp::SvgElement*)src)->_TagName);
            for(libhtmlpp::SvgElement::Attributes *cattr=((libhtmlpp::SvgElement*)src)->_firstAttr; cattr; cattr=cattr->_nextAttr){
                if(!cattr->_Value.empty()){