mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end tags to reduce matching cost for end tags; extended tests; updated to avoid breaking previous changes to support IPv6 addresses in unquoted attribute values)
This commit is contained in:
parent
960a3f88e5
commit
a136210a9f
2 changed files with 25 additions and 9 deletions
|
@ -286,6 +286,21 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
|
|||
('codepoint', 'convert', 42),
|
||||
])
|
||||
|
||||
def test_attr_values_quoted_markup(self):
|
||||
"""Multi-line and markup in attribute values"""
|
||||
self.check_events("""<a title='foo\n<br>bar'>text</a>""",
|
||||
[("starttag", "a", [("title", "foo\n<br>bar")]),
|
||||
("data", "text"),
|
||||
("endtag", "a")])
|
||||
self.check_events("""<a title='less < than'>text</a>""",
|
||||
[("starttag", "a", [("title", "less < than")]),
|
||||
("data", "text"),
|
||||
("endtag", "a")])
|
||||
self.check_events("""<a title='greater > than'>text</a>""",
|
||||
[("starttag", "a", [("title", "greater > than")]),
|
||||
("data", "text"),
|
||||
("endtag", "a")])
|
||||
|
||||
def test_attr_funky_names(self):
|
||||
self.check_events("""<a a.b='v' c:d=v e-f=v>""", [
|
||||
("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue