Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0b9b13

Browse files
valievkarimgsnedders
authored andcommitted
Fix forhtml5lib#33: null in attribute value breaks XML AttValue
In several places we were only checking for null in the state'sif-statement and not breaking out of charsUntil for it.
1 parent073d792 commitd0b9b13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎html5lib/tokenizer.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def rcdataState(self):
306306
# have already been appended to lastFourChars and will have broken
307307
# any <!-- or --> sequences
308308
else:
309-
chars=self.stream.charsUntil(("&","<"))
309+
chars=self.stream.charsUntil(("&","<","\u0000"))
310310
self.tokenQueue.append({"type":tokenTypes["Characters"],"data":
311311
data+chars})
312312
returnTrue
@@ -1016,7 +1016,7 @@ def attributeValueDoubleQuotedState(self):
10161016
self.state=self.dataState
10171017
else:
10181018
self.currentToken["data"][-1][1]+=data+\
1019-
self.stream.charsUntil(("\"","&"))
1019+
self.stream.charsUntil(("\"","&","\u0000"))
10201020
returnTrue
10211021

10221022
defattributeValueSingleQuotedState(self):
@@ -1035,7 +1035,7 @@ def attributeValueSingleQuotedState(self):
10351035
self.state=self.dataState
10361036
else:
10371037
self.currentToken["data"][-1][1]+=data+\
1038-
self.stream.charsUntil(("'","&"))
1038+
self.stream.charsUntil(("'","&","\u0000"))
10391039
returnTrue
10401040

10411041
defattributeValueUnQuotedState(self):
@@ -1060,7 +1060,7 @@ def attributeValueUnQuotedState(self):
10601060
self.state=self.dataState
10611061
else:
10621062
self.currentToken["data"][-1][1]+=data+self.stream.charsUntil(
1063-
frozenset(("&",">",'"',"'","=","<","`"))|spaceCharacters)
1063+
frozenset(("&",">",'"',"'","=","<","`","\u0000"))|spaceCharacters)
10641064
returnTrue
10651065

10661066
defafterAttributeValueState(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp