Loading src/html.cpp +52 −36 Original line number Diff line number Diff line Loading @@ -2336,7 +2336,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2345,7 +2350,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); Loading Loading @@ -2423,7 +2427,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2432,7 +2441,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); if(formated){ Loading Loading @@ -2473,7 +2481,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2482,7 +2495,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); if(formated){ Loading Loading @@ -2523,7 +2535,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2532,7 +2549,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); std::copy( static_cast<const TextArea*>(el)->_Text.begin(), Loading Loading
src/html.cpp +52 −36 Original line number Diff line number Diff line Loading @@ -2336,7 +2336,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2345,7 +2350,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); Loading Loading @@ -2423,7 +2427,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2432,7 +2441,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); if(formated){ Loading Loading @@ -2473,7 +2481,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2482,7 +2495,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); if(formated){ Loading Loading @@ -2523,7 +2535,12 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) curattr->_Key.end(), std::back_inserter(output) ); if(!curattr->_Value.empty()){ // Always emit ="value", even when value is empty -- matches // the WHATWG HTML fragment serialization algorithm (browsers' // outerHTML never drops the ="" for e.g. alt="" or a boolean // attribute like disabled) and keeps round-tripping stable: // an attribute with an explicit empty value stays // distinguishable in the output from one with none. output.append("=\""); std::copy( curattr->_Value.begin(), Loading @@ -2532,7 +2549,6 @@ void libhtmlpp::print(const Element &element, HtmlString &output,bool formated) ); output.append("\""); } } output.append(">"); std::copy( static_cast<const TextArea*>(el)->_Text.begin(), Loading