diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-10-28 10:23:57 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-10-28 10:23:57 (GMT) |
| commit | 91ec2e8a313edd08b4f10775173bbff714d8050a (patch) | |
| tree | 92184035cee266c344b3caf304cf7ae8b995acf7 /Lib/html/parser.py | |
| parent | 455036fd1fe0580cb1e45e86cec268e07e5baf70 (diff) | |
| parent | f50ffa94abe67c6ef5e615198af15f72e7cd2a9b (diff) | |
| download | cpython-91ec2e8a313edd08b4f10775173bbff714d8050a.zip cpython-91ec2e8a313edd08b4f10775173bbff714d8050a.tar.gz cpython-91ec2e8a313edd08b4f10775173bbff714d8050a.tar.bz2 | |
#13273: merge with 3.2.
Diffstat (limited to 'Lib/html/parser.py')
| -rw-r--r-- | Lib/html/parser.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py index a6d5be9..affaf73 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -30,7 +30,7 @@ attrfind = re.compile( r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' r'(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?') attrfind_tolerant = re.compile( - r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' + r',?\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' r'(\'[^\']*\'|"[^"]*"|[^>\s]*))?') locatestarttagend = re.compile(r""" <[a-zA-Z][-.a-zA-Z0-9:_]* # tag name @@ -277,12 +277,11 @@ class HTMLParser(_markupbase.ParserBase): assert match, 'unexpected call to parse_starttag()' k = match.end() self.lasttag = tag = rawdata[i+1:k].lower() - while k < endpos: if self.strict: m = attrfind.match(rawdata, k) else: - m = attrfind_tolerant.search(rawdata, k) + m = attrfind_tolerant.match(rawdata, k) if not m: break attrname, rest, attrvalue = m.group(1, 2, 3) |
