String MarkupAccumulator::serializeNodes(Node* node, Node* nodeToSkip, EChildrenOnly childrenOnly) { StringBuilder out; serializeNodesWithNamespaces(node, nodeToSkip, childrenOnly, 0); out.reserveCapacity(length()); concatenateMarkup(out); return out.toString(); }
String StyledMarkupAccumulator::takeResults() { StringBuilder result; result.reserveCapacity(totalLength(m_reversedPrecedingMarkup) + length()); for (size_t i = m_reversedPrecedingMarkup.size(); i > 0; --i) result.append(m_reversedPrecedingMarkup[i - 1]); concatenateMarkup(result); // We remove '\0' characters because they are not visibly rendered to the user. return result.toString().replace(0, ""); }