1
0
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:
Jonas Fonseca 2005-12-29 20:38:43 +01:00 committed by Jonas Fonseca
parent 958a4a1b51
commit 57168e1fbc
2 changed files with 13 additions and 0 deletions

View File

@ -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--;
}
}

View File

@ -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.' \
'&amp;-&#42;' \