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