A bit more work on fixing the html argument parser's indexing.

This commit is contained in:
Relintai 2021-11-18 07:18:35 +01:00
parent 1fcc47b353
commit 43a7185e23

View File

@ -118,13 +118,13 @@ void HTMLParserTag::parse_args(const String &args) {
return; return;
} }
a.attribute = args.substr(i, args.size() - equals_index - 1); a.attribute = args.substr(i, equals_index - i);
a.attribute.print(); //a.attribute.print();
//todo //todo
//a.trim(); //a.trim();
int next_char_index = equals_index; int next_char_index = equals_index + 1;
//skip spaces //skip spaces
while (data[next_char_index] == ' ') { while (data[next_char_index] == ' ') {
@ -155,15 +155,17 @@ void HTMLParserTag::parse_args(const String &args) {
a.data = args.substr(next_char_index, args.size() - next_char_index - 1); a.data = args.substr(next_char_index, args.size() - next_char_index - 1);
attributes.push_back(a); attributes.push_back(a);
//a.data.print(); a.data.print();
return; return;
} }
a.data = args.substr(next_char_index, args.size() - end_index - 2); a.data = args.substr(next_char_index, end_index - next_char_index - 1);
attributes.push_back(a); attributes.push_back(a);
//a.data.print(); //a.data.print();
i = end_index + 1; i = end_index + 1;
printf("\n");
} }
} }