1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net.html: add get_tags_by_class_name (#17024)

This commit is contained in:
Minsoo
2023-01-19 02:00:46 +09:00
committed by GitHub
parent 6688c0f3d7
commit d850d3caba
5 changed files with 97 additions and 0 deletions

View File

@ -151,6 +151,13 @@ pub fn (mut parser Parser) split_parse(data string) {
nval := temp_lexeme.substr(1, temp_lexeme.len - 1)
// parser.print_debug(lattr + " = " + temp_lexeme)
parser.lexical_attributes.current_tag.attributes[lattr] = nval
if lattr == 'class' {
for class_name in nval.split_any('\t\r\n \x0D') {
if class_name != '' {
parser.lexical_attributes.current_tag.class_set.add(class_name)
}
}
}
parser.lexical_attributes.current_tag.last_attribute = ''
} else {
parser.lexical_attributes.current_tag.attributes[temp_lexeme.to_lower()] = ''