summaryrefslogtreecommitdiff
path: root/src/html_token.cpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-06-23 10:25:52 -0400
committermattkae <mattkae@protonmail.com>2023-06-23 10:25:52 -0400
commit4feb59d831d395369aa21d77e9b9d293125421d1 (patch)
tree7657a6ea15fc6a873c89cb2d03b75f56767bae71 /src/html_token.cpp
parent29e03ef74a814cb31a0ae53192e25cc75b638256 (diff)
Able to parse double quoted HTML attributesHEADmaster
Diffstat (limited to 'src/html_token.cpp')
-rw-r--r--src/html_token.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/html_token.cpp b/src/html_token.cpp
index 1d0952d..1eabaa8 100644
--- a/src/html_token.cpp
+++ b/src/html_token.cpp
@@ -5,7 +5,6 @@ const char* TOKEN_TO_NAME_MAP[HtmlTokenType_Length] = {
"Text",
"Start Tag",
"End Tag",
- "Attribute",
"EOF",
"Character"
};
@@ -18,7 +17,12 @@ void HtmlToken::print() {
break;
case HtmlTokenType_StartTag:
case HtmlTokenType_EndTag:
- logger_info("%s, %S", name, tag_name.c_str());
+ logger_info("%s, %S, attributes: %lu", name, tag_name.c_str(), attributes.size());
+
+ for (auto i = 0; i < attributes.size(); i++) {
+ HtmlAttribute& attribute = attributes[i];
+ printf("\tattribute: %S=%S\n", attribute.name.c_str(), attribute.value.c_str());
+ }
break;
default:
logger_info("%s", name);
@@ -29,4 +33,5 @@ void HtmlToken::reset() {
type = HtmlTokenType_None;
tag_name.clear();
code_entity.clear();
+ attributes.clear();
}