File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1716,21 +1716,18 @@ def cdataSectionState(self):
17161716 data = []
17171717 while True :
17181718 data .append (self .stream .charsUntil ("]" ))
1719- charStack = []
1720-
1721- for expected in ["]" , "]" , ">" ]:
1722- charStack .append (self .stream .char ())
1723- matched = True
1724- if charStack [- 1 ] == EOF :
1725- data .extend (charStack [:- 1 ])
1726- break
1727- elif charStack [- 1 ] != expected :
1728- matched = False
1729- data .extend (charStack )
1719+ data .append (self .stream .charsUntil (">" ))
1720+ char = self .stream .char ()
1721+ if char == EOF :
1722+ break
1723+ else :
1724+ assert char == ">"
1725+ if data [- 1 ][- 2 :] == "]]" :
1726+ data [- 1 ] = data [- 1 ][:- 2 ]
17301727 break
1728+ else :
1729+ data .append (char )
17311730
1732- if matched :
1733- break
17341731 data = "" .join (data )
17351732 #Deal with null here rather than in the parser
17361733 nullCount = data .count ("\u0000 " )
You can’t perform that action at this time.
0 commit comments