diff options
Diffstat (limited to 'src/html_token.cpp')
-rw-r--r-- | src/html_token.cpp | 9 |
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(); } |