mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
net.html: add get_tags_by_class_name (#17024)
This commit is contained in:
parent
6688c0f3d7
commit
d850d3caba
5 changed files with 97 additions and 0 deletions
|
@ -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()] = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue