mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Handle <element path=/to/%61-&\one";files/> as a self-closing tag
Before the '/' before '>' would be interpreted as part of the attribute value. Hope this is sensible slurping of the markup soup.
This commit is contained in:
parent
958a4a1b51
commit
57168e1fbc
@ -338,6 +338,8 @@ scan_sgml_element_token(struct dom_scanner *scanner, struct dom_scanner_token *t
|
||||
} else if (is_sgml_attribute(*string)) {
|
||||
scan_sgml_attribute(scanner, string);
|
||||
type = SGML_TOKEN_ATTRIBUTE;
|
||||
if (string[-1] == '/' && string[0] == '>')
|
||||
string--;
|
||||
}
|
||||
|
||||
} else if (isquote(first_char)) {
|
||||
@ -365,6 +367,8 @@ scan_sgml_element_token(struct dom_scanner *scanner, struct dom_scanner_token *t
|
||||
if (is_sgml_attribute(*string)) {
|
||||
scan_sgml_attribute(scanner, string);
|
||||
type = SGML_TOKEN_ATTRIBUTE;
|
||||
if (string[-1] == '/' && string[0] == '>')
|
||||
string--;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,15 @@ element: root
|
||||
attribute: i -> j
|
||||
attribute: k -> '
|
||||
|
||||
test_output_equals \
|
||||
'Parse attribute with non-quoted values.' \
|
||||
'<root color=#abc path=/to/%61-&\one";files/>...' \
|
||||
'
|
||||
element: root
|
||||
attribute: color -> #abc
|
||||
attribute: path -> /to/%61-&\one";files
|
||||
#text: ...'
|
||||
|
||||
test_output_equals \
|
||||
'Parse entity references.' \
|
||||
'&-*' \
|
||||
|
Loading…
Reference in New Issue
Block a user