Make html parser use case insensitive unordered_map for attributes

This commit is contained in:
2026-09-25 16:17:11 -05:00
parent 95442f8acc
commit 15f08f474f
6 changed files with 37 additions and 21 deletions
+7 -7
View File
@@ -58,13 +58,13 @@ int main(int argc, char **argv) {
html->FindNodes("meta", metaTags);
for (auto &meta : metaTags) {
std::optional<std::string> prop, content;
for (auto &[k, v] : meta->attributes) {
if (k == "property" && v)
prop = *v;
if (k == "content" && v)
content = *v;
}
auto prop_off = meta->attributes.find("property");
auto content_off = meta->attributes.find("content");
if (!(prop_off != meta->attributes.end() &&
content_off != meta->attributes.end()))
continue;
auto &prop = prop_off->second;
auto &content = content_off->second;
if (prop && content && prop->find("og:") == 0) {
Tesses::Framework::Console::WriteView(prop.value());