From fb38c76e0f15e15d08e4635a24719cc120809191 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 16 Jul 2001 18:30:35 +0000 Subject: 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. --- Lib/sgmllib.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index 5ff9f70c96..3422980834 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('