From e4ca34aa597c9b0955aa23c18c500048af697c92 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Fri, 25 Sep 2026 16:35:03 -0500 Subject: [PATCH] Make html parser use case insensitive unordered_map for attributes --- apps/thtml2json.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/thtml2json.cpp b/apps/thtml2json.cpp index a49dbca..48df5c8 100644 --- a/apps/thtml2json.cpp +++ b/apps/thtml2json.cpp @@ -11,8 +11,11 @@ Json::JToken Html2JToken(std::shared_ptr node) { obj.SetValue("Tag", node->text_or_tag); Json::JObject attrs; for (auto &item : node->attributes) { - attrs.SetValue(item.first, - item.second.value_or(nullptr)); + if (item.second) { + attrs.SetValue(item.first, *item.second); + } else { + attrs.SetValue(item.first, nullptr); + } } obj.SetValue("Attributes", attrs);