mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	#7311: fix html.parser to accept non-ASCII attribute values.
This commit is contained in:
		
							parent
							
								
									9b5ac3efa6
								
							
						
					
					
						commit
						2e3607c1e7
					
				
					 3 changed files with 20 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -217,6 +217,23 @@ def test_attr_values(self):
 | 
			
		|||
            ("starttag", "a", [("href", "mailto:xyz@example.com")]),
 | 
			
		||||
            ])
 | 
			
		||||
 | 
			
		||||
    def test_attr_nonascii(self):
 | 
			
		||||
        # see issue 7311
 | 
			
		||||
        self._run_check("<img src=/foo/bar.png alt=\u4e2d\u6587>", [
 | 
			
		||||
            ("starttag", "img", [("src", "/foo/bar.png"),
 | 
			
		||||
                                 ("alt", "\u4e2d\u6587")]),
 | 
			
		||||
            ])
 | 
			
		||||
        self._run_check("<a title='\u30c6\u30b9\u30c8' "
 | 
			
		||||
                        "href='\u30c6\u30b9\u30c8.html'>", [
 | 
			
		||||
            ("starttag", "a", [("title", "\u30c6\u30b9\u30c8"),
 | 
			
		||||
                               ("href", "\u30c6\u30b9\u30c8.html")]),
 | 
			
		||||
            ])
 | 
			
		||||
        self._run_check('<a title="\u30c6\u30b9\u30c8" '
 | 
			
		||||
                        'href="\u30c6\u30b9\u30c8.html">', [
 | 
			
		||||
            ("starttag", "a", [("title", "\u30c6\u30b9\u30c8"),
 | 
			
		||||
                               ("href", "\u30c6\u30b9\u30c8.html")]),
 | 
			
		||||
            ])
 | 
			
		||||
 | 
			
		||||
    def test_attr_entity_replacement(self):
 | 
			
		||||
        self._run_check("""<a b='&><"''>""", [
 | 
			
		||||
            ("starttag", "a", [("b", "&><\"'")]),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue