@@ -623,7 +623,7 @@ def test_correct_detection_of_start_tags(self):
623
623
624
624
html = '<div style="", foo = "bar" ><b>The <a href="some_url">rain</a>'
625
625
expected = [
626
- ('starttag' , 'div' , [('style' , '' ), (',' , None ), ('foo' , None ), ( '=' , None ), ( '" bar"' , None )]),
626
+ ('starttag' , 'div' , [('style' , '' ), (',' , None ), ('foo' , ' bar' )]),
627
627
('starttag' , 'b' , []),
628
628
('data' , 'The ' ),
629
629
('starttag' , 'a' , [('href' , 'some_url' )]),
@@ -813,12 +813,12 @@ def test_attr_syntax(self):
813
813
]
814
814
self ._run_check ("""<a b='v' c="v" d=v e>""" , output )
815
815
self ._run_check ("<a foo==bar>" , [('starttag' , 'a' , [('foo' , '=bar' )])])
816
- self ._run_check ("<a foo =bar>" , [('starttag' , 'a' , [('foo' , None ), ( '= bar', None )])])
817
- self ._run_check ("<a foo\t =bar>" , [('starttag' , 'a' , [('foo' , None ), ( '= bar', None )])])
816
+ self ._run_check ("<a foo =bar>" , [('starttag' , 'a' , [('foo' , ' bar' )])])
817
+ self ._run_check ("<a foo\t =bar>" , [('starttag' , 'a' , [('foo' , ' bar' )])])
818
818
self ._run_check ("<a foo\v =bar>" , [('starttag' , 'a' , [('foo\v ' , 'bar' )])])
819
819
self ._run_check ("<a foo\xa0 =bar>" , [('starttag' , 'a' , [('foo\xa0 ' , 'bar' )])])
820
- self ._run_check ("<a foo= bar>" , [('starttag' , 'a' , [('foo' , '' ), ( ' bar', None )])])
821
- self ._run_check ("<a foo=\t bar>" , [('starttag' , 'a' , [('foo' , '' ), ( ' bar', None )])])
820
+ self ._run_check ("<a foo= bar>" , [('starttag' , 'a' , [('foo' , 'bar' )])])
821
+ self ._run_check ("<a foo=\t bar>" , [('starttag' , 'a' , [('foo' , 'bar' )])])
822
822
self ._run_check ("<a foo=\v bar>" , [('starttag' , 'a' , [('foo' , '\v bar' )])])
823
823
self ._run_check ("<a foo=\xa0 bar>" , [('starttag' , 'a' , [('foo' , '\xa0 bar' )])])
824
824
@@ -829,8 +829,8 @@ def test_attr_values(self):
829
829
("d" , "\t xyz\n " )])])
830
830
self ._run_check ("""<a b='' c="">""" ,
831
831
[("starttag" , "a" , [("b" , "" ), ("c" , "" )])])
832
- self ._run_check ("<a b=\t c=\n >" ,
833
- [(" starttag" , "a" , [("b" , "" ), ("c" , "" )])])
832
+ self ._run_check ("<a b=\t x c=\n y >" ,
833
+ [(' starttag' , 'a' , [('b' , 'x' ), ('c' , 'y' )])])
834
834
self ._run_check ("<a b=\v c=\xa0 >" ,
835
835
[("starttag" , "a" , [("b" , "\v " ), ("c" , "\xa0 " )])])
836
836
# Regression test for SF patch #669683.
@@ -899,13 +899,17 @@ def test_malformed_attributes(self):
899
899
)
900
900
expected = [
901
901
('starttag' , 'a' , [('href' , "test'style='color:red;bad1'" )]),
902
- ('data' , 'test - bad1' ), ('endtag' , 'a' ),
902
+ ('data' , 'test - bad1' ),
903
+ ('endtag' , 'a' ),
903
904
('starttag' , 'a' , [('href' , "test'+style='color:red;ba2'" )]),
904
- ('data' , 'test - bad2' ), ('endtag' , 'a' ),
905
+ ('data' , 'test - bad2' ),
906
+ ('endtag' , 'a' ),
905
907
('starttag' , 'a' , [('href' , "test'\xa0 style='color:red;bad3'" )]),
906
- ('data' , 'test - bad3' ), ('endtag' , 'a' ),
907
- ('starttag' , 'a' , [('href' , None ), ('=' , None ), ("test' style" , 'color:red;bad4' )]),
908
- ('data' , 'test - bad4' ), ('endtag' , 'a' )
908
+ ('data' , 'test - bad3' ),
909
+ ('endtag' , 'a' ),
910
+ ('starttag' , 'a' , [('href' , "test'\xa0 style='color:red;bad4'" )]),
911
+ ('data' , 'test - bad4' ),
912
+ ('endtag' , 'a' ),
909
913
]
910
914
self ._run_check (html , expected )
911
915
0 commit comments