From: Guido van Rossum Date: Thu, 28 May 1998 22:48:53 +0000 (+0000) Subject: Patch by Lars Marius Garshol: X-Git-Tag: v1.5.2a1~532 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ad00717fb90ebfe1bb7727f9a89b1b06ebf9e5f;p=python Patch by Lars Marius Garshol: - Handle . - Allow . and - in entity names. Also fixed an oversight in the previous fix (in one place, [ \t\r\n] was used instead of string.whitespace). --- diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index 956341c8fe..681760854f 100644 --- a/Lib/sgmllib.py +++ b/Lib/sgmllib.py @@ -20,12 +20,14 @@ incomplete = re.compile('&([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|' '/([a-zA-Z][^<>]*)?|' '![^<>]*)?') -entityref = re.compile('&([a-zA-Z][a-zA-Z0-9]*)[^a-zA-Z0-9]') +entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('&#([0-9]+)[^0-9]') starttagopen = re.compile('<[>a-zA-Z]') shorttagopen = re.compile('<[a-zA-Z][a-zA-Z0-9]*/') shorttag = re.compile('<([a-zA-Z][a-zA-Z0-9]*)/([^/]*)/') +piopen = re.compile('<\?') +piclose = re.compile('>') endtagopen = re.compile('a-zA-Z]') endbracket = re.compile('[<>]') special = re.compile(']*>') @@ -33,7 +35,7 @@ commentopen = re.compile('