Pre-subnode update.

This commit is contained in:
2023-07-10 12:04:34 -07:00
parent 835d5e5892
commit 1c7abbf140
3 changed files with 16 additions and 7 deletions

View File

@ -149,12 +149,18 @@ void Xml::load(Xml *xml, std::string data, size_t *j) {
case XML_PARSE_STATE_PARSING_VALUE:
// Keep parsing child until we find a < for an opening/closing tag.
if(c == '<' && !(data[i] == '<' || data[i-2] == '<')) {
// In HTML Spec there could be a child here but not in XML spec.
doing = XML_PARSE_STATE_PARSING_CLOSE;
xml->value = buffer;
buffer.clear();
valueIsInWhitespace = false;
bufferWhitespaces.clear();
if(data[i] == '/') {
// In HTML Spec there could be a child here but not in XML spec.
doing = XML_PARSE_STATE_PARSING_CLOSE;
xml->value = buffer;
buffer.clear();
valueIsInWhitespace = false;
bufferWhitespaces.clear();
continue;
}
std::cout << "Detected unsupported use of a child within a node value, e.g. <div>Hello <b>world</b> how are you?</div>" << std::endl;
throw "Test";
continue;
}