From: Fred Drake Date: Mon, 16 Jul 2001 18:30:35 +0000 (+0000) Subject: In CDATA mode, make sure entity-reference syntax is not interpreted; X-Git-Tag: v2.2a3~1136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb38c76e0f15e15d08e4635a24719cc120809191;p=thirdparty%2FPython%2Fcpython.git In CDATA mode, make sure entity-reference syntax is not interpreted; entity references are not allowed in that mode. Do a better job of scanning declarations; based on the code in HTMLParser.py. --- diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index 5ff9f70c96ad..342298083401 100644 --- a/Lib/sgmllib.py +++ b/Lib/sgmllib.py @@ -5,7 +5,8 @@ # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) -# and CDATA (character data -- only end tags are special). +# and CDATA (character data -- only end tags are special). RCDATA is +# not supported at all. import re @@ -34,6 +35,9 @@ endbracket = re.compile('[<>]') special = re.compile(']*>') commentopen = re.compile('