fix doctype serialization by spec

Implement missing serialization of:
- PUBLIC/SYSTEM
- systemId
-publicId
This commit is contained in:
Кирилл Жумарин 2018-06-02 11:12:15 +03:00 committed by GitHub
parent 2d8e6a3444
commit 6224a68f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,6 +146,35 @@ mystatus_t myhtml_serialization_node_callback(myhtml_tree_node_t* node, mycore_c
if(attr && attr->key.data && attr->key.length) {
if(callback(attr->key.data, attr->key.length, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
attr = attr->next;
if(attr && attr->value.length == 6) {
if(strcasecmp(attr->value.data, "SYSTEM") == 0) {
if(callback(" SYSTEM", 7, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
} else if(strcasecmp(attr->value.data, "PUBLIC") == 0) {
if(callback(" PUBLIC", 7, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
}
attr = attr->next;
while (attr) {
if(callback(" \"", 2, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
if(attr->value.data && attr->value.length) {
if(callback(attr->value.data, attr->value.length, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
}
if(callback("\"", 1, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;
attr = attr->next;
}
}
}
}