@@ -596,7 +596,7 @@ def test_correct_detection_of_start_tags(self):
596
596
597
597
html = '<div style="", foo = "bar" ><b>The <a href="some_url">rain</a>'
598
598
expected = [
599
- ('starttag' , 'div' , [('style' , '' ), (',' , None ), ('foo' , None ), ( '=' , None ), ( '" bar"' , None )]),
599
+ ('starttag' , 'div' , [('style' , '' ), (',' , None ), ('foo' , ' bar' )]),
600
600
('starttag' , 'b' , []),
601
601
('data' , 'The ' ),
602
602
('starttag' , 'a' , [('href' , 'some_url' )]),
@@ -752,12 +752,12 @@ def test_attr_syntax(self):
752
752
]
753
753
self ._run_check ("""<a b='v' c="v" d=v e>""" , output )
754
754
self ._run_check ("<a foo==bar>" , [('starttag' , 'a' , [('foo' , '=bar' )])])
755
- self ._run_check ("<a foo =bar>" , [('starttag' , 'a' , [('foo' , None ), ( '= bar', None )])])
756
- self ._run_check ("<a foo\t =bar>" , [('starttag' , 'a' , [('foo' , None ), ( '= bar', None )])])
755
+ self ._run_check ("<a foo =bar>" , [('starttag' , 'a' , [('foo' , ' bar' )])])
756
+ self ._run_check ("<a foo\t =bar>" , [('starttag' , 'a' , [('foo' , ' bar' )])])
757
757
self ._run_check ("<a foo\v =bar>" , [('starttag' , 'a' , [('foo\v ' , 'bar' )])])
758
758
self ._run_check ("<a foo\xa0 =bar>" , [('starttag' , 'a' , [('foo\xa0 ' , 'bar' )])])
759
- self ._run_check ("<a foo= bar>" , [('starttag' , 'a' , [('foo' , '' ), ( ' bar', None )])])
760
- self ._run_check ("<a foo=\t bar>" , [('starttag' , 'a' , [('foo' , '' ), ( ' bar', None )])])
759
+ self ._run_check ("<a foo= bar>" , [('starttag' , 'a' , [('foo' , 'bar' )])])
760
+ self ._run_check ("<a foo=\t bar>" , [('starttag' , 'a' , [('foo' , 'bar' )])])
761
761
self ._run_check ("<a foo=\v bar>" , [('starttag' , 'a' , [('foo' , '\v bar' )])])
762
762
self ._run_check ("<a foo=\xa0 bar>" , [('starttag' , 'a' , [('foo' , '\xa0 bar' )])])
763
763
@@ -768,8 +768,8 @@ def test_attr_values(self):
768
768
("d" , "\t xyz\n " )])])
769
769
self ._run_check ("""<a b='' c="">""" ,
770
770
[("starttag" , "a" , [("b" , "" ), ("c" , "" )])])
771
- self ._run_check ("<a b=\t c=\n >" ,
772
- [(" starttag" , "a" , [("b" , "" ), ("c" , "" )])])
771
+ self ._run_check ("<a b=\t x c=\n y >" ,
772
+ [(' starttag' , 'a' , [('b' , 'x' ), ('c' , 'y' )])])
773
773
self ._run_check ("<a b=\v c=\xa0 >" ,
774
774
[("starttag" , "a" , [("b" , "\v " ), ("c" , "\xa0 " )])])
775
775
# Regression test for SF patch #669683.
@@ -838,13 +838,17 @@ def test_malformed_attributes(self):
838
838
)
839
839
expected = [
840
840
('starttag' , 'a' , [('href' , "test'style='color:red;bad1'" )]),
841
- ('data' , 'test - bad1' ), ('endtag' , 'a' ),
841
+ ('data' , 'test - bad1' ),
842
+ ('endtag' , 'a' ),
842
843
('starttag' , 'a' , [('href' , "test'+style='color:red;ba2'" )]),
843
- ('data' , 'test - bad2' ), ('endtag' , 'a' ),
844
+ ('data' , 'test - bad2' ),
845
+ ('endtag' , 'a' ),
844
846
('starttag' , 'a' , [('href' , "test'\xa0 style='color:red;bad3'" )]),
845
- ('data' , 'test - bad3' ), ('endtag' , 'a' ),
846
- ('starttag' , 'a' , [('href' , None ), ('=' , None ), ("test' style" , 'color:red;bad4' )]),
847
- ('data' , 'test - bad4' ), ('endtag' , 'a' )
847
+ ('data' , 'test - bad3' ),
848
+ ('endtag' , 'a' ),
849
+ ('starttag' , 'a' , [('href' , "test'\xa0 style='color:red;bad4'" )]),
850
+ ('data' , 'test - bad4' ),
851
+ ('endtag' , 'a' ),
848
852
]
849
853
self ._run_check (html , expected )
850
854
0 commit comments