mirror of
https://git.tesses.org/tesses50/tessesframework.git
synced 2026-09-30 16:54:14 +00:00
Make html parser use case insensitive unordered_map for attributes
This commit is contained in:
+5
-2
@@ -11,8 +11,11 @@ Json::JToken Html2JToken(std::shared_ptr<Html::HtmlNode> node) {
|
|||||||
obj.SetValue("Tag", node->text_or_tag);
|
obj.SetValue("Tag", node->text_or_tag);
|
||||||
Json::JObject attrs;
|
Json::JObject attrs;
|
||||||
for (auto &item : node->attributes) {
|
for (auto &item : node->attributes) {
|
||||||
attrs.SetValue(item.first,
|
if (item.second) {
|
||||||
item.second.value_or<Json::JToken>(nullptr));
|
attrs.SetValue(item.first, *item.second);
|
||||||
|
} else {
|
||||||
|
attrs.SetValue(item.first, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
obj.SetValue("Attributes", attrs);
|
obj.SetValue("Attributes", attrs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user