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

Commit8b4d7c4

Browse files
committed
Drop the content model requirements from lint
1 parentfbbea1f commit8b4d7c4

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

‎html5lib/filters/lint.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fromsiximporttext_type
44

55
from .import_base
6-
from ..constantsimportcdataElements,rcdataElements,voidElements
6+
from ..constantsimportvoidElements
77

88
from ..constantsimportspaceCharacters
99
spaceCharacters="".join(spaceCharacters)
@@ -16,13 +16,10 @@ class LintError(Exception):
1616
classFilter(_base.Filter):
1717
def__iter__(self):
1818
open_elements= []
19-
contentModelFlag="PCDATA"
2019
fortokenin_base.Filter.__iter__(self):
2120
type=token["type"]
2221
iftypein ("StartTag","EmptyTag"):
2322
name=token["name"]
24-
ifcontentModelFlag!="PCDATA":
25-
raiseLintError("StartTag not in PCDATA content model flag: %(tag)s"% {"tag":name})
2623
ifnotisinstance(name,text_type):
2724
raiseLintError("Tag name is not a string: %(tag)r"% {"tag":name})
2825
ifnotname:
@@ -44,12 +41,6 @@ def __iter__(self):
4441
raiseLintError("Empty attribute localname")
4542
ifnotisinstance(value,text_type):
4643
raiseLintError("Attribute value is not a string: %(value)r"% {"value":value})
47-
ifnameincdataElements:
48-
contentModelFlag="CDATA"
49-
elifnameinrcdataElements:
50-
contentModelFlag="RCDATA"
51-
elifname=="plaintext":
52-
contentModelFlag="PLAINTEXT"
5344

5445
eliftype=="EndTag":
5546
name=token["name"]
@@ -62,11 +53,9 @@ def __iter__(self):
6253
start_name=open_elements.pop()
6354
ifstart_name!=name:
6455
raiseLintError("EndTag (%(end)s) does not match StartTag (%(start)s)"% {"end":name,"start":start_name})
65-
contentModelFlag="PCDATA"
6656

6757
eliftype=="Comment":
68-
ifcontentModelFlag!="PCDATA":
69-
raiseLintError("Comment not in PCDATA content model flag")
58+
pass
7059

7160
eliftypein ("Characters","SpaceCharacters"):
7261
data=token["data"]
@@ -81,8 +70,6 @@ def __iter__(self):
8170

8271
eliftype=="Doctype":
8372
name=token["name"]
84-
ifcontentModelFlag!="PCDATA":
85-
raiseLintError("Doctype not in PCDATA content model flag: %(name)s"% {"name":name})
8673
ifnotisinstance(name,text_type):
8774
raiseLintError("Tag name is not a string: %(tag)r"% {"tag":name})
8875
# XXX: what to do with token["data"] ?

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp