*** htmlparser_orig.py Mon Jun 16 22:12:41 2003 --- htmlparser.py Mon Jun 16 23:01:42 2003 *************** *** 26,41 **** tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9:_]*') attrfind = re.compile( r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' ! r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~]*))?') locatestarttagend = re.compile(r""" <[a-zA-Z][-.a-zA-Z0-9:_]* # tag name ! (?:\s+ # whitespace before attribute name (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name (?:\s*=\s* # value indicator (?:'[^']*' # LITA-enclosed value |\"[^\"]*\" # LIT-enclosed value ! |[^'\">\s]+ # bare value ) )? ) --- 26,42 ---- tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9:_]*') attrfind = re.compile( r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' ! r'(\'[^\']*\'|"[^"]*"|[^\'">\s][^>\s]*|(?=/?>)))?') locatestarttagend = re.compile(r""" <[a-zA-Z][-.a-zA-Z0-9:_]* # tag name ! (?:\s* # whitespace before attribute name (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name (?:\s*=\s* # value indicator (?:'[^']*' # LITA-enclosed value |\"[^\"]*\" # LIT-enclosed value ! |[^'\">\s][^>\s]* # bare value ! |(?=/?>) # or ) )? ) diff test_htmlparser_orig.py test_htmlparser.py 256c256 < self._parse_error("") --- > #self._parse_error("") 294a295,306 > def test_adjacent_attr(self): > self._run_check("""""", > [("starttag", "a", [("width", "100%"), > ("cellspacing","0")])]) > > def test_missing_attr_val(self): > self._run_check("""""", [("starttag", "a", [("v", "")])]) > > def test_js_attr_val(self): > self._run_check("""""", > [("starttag", "a", > [("href", "javascript:popup('/popup/help.html')")])])