File tree 1 file changed +10
-13
lines changed 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -1716,21 +1716,18 @@ def cdataSectionState(self):
1716
1716
data = []
1717
1717
while True :
1718
1718
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 ]
1730
1727
break
1728
+ else :
1729
+ data .append (char )
1731
1730
1732
- if matched :
1733
- break
1734
1731
data = "" .join (data )
1735
1732
#Deal with null here rather than in the parser
1736
1733
nullCount = data .count ("\u0000 " )
You can’t perform that action at this time.
0 commit comments