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

Commit9f4b251

Browse files
committed
r2129 of spec: <optgroup> implies </option>
--HG--extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401215
1 parent54bb5ec commit9f4b251

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/html5lib/filters/optionaltags.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,13 @@ def is_optional_end(self, tagname, next):
8181
# An html element's end tag may be omitted if the html element
8282
# is not immediately followed by a space character or a comment.
8383
returntypenotin ("Comment","SpaceCharacters")
84-
eliftagnamein ('li','optgroup','option','tr'):
84+
eliftagnamein ('li','optgroup','tr'):
8585
# A li element's end tag may be omitted if the li element is
8686
# immediately followed by another li element or if there is
8787
# no more content in the parent element.
8888
# An optgroup element's end tag may be omitted if the optgroup
8989
# element is immediately followed by another optgroup element,
9090
# or if there is no more content in the parent element.
91-
# An option element's end tag may be omitted if the option
92-
# element is immediately followed by another option element,
93-
# or if there is no more content in the parent element.
9491
# A tr element's end tag may be omitted if the tr element is
9592
# immediately followed by another tr element, or if there is
9693
# no more content in the parent element.
@@ -125,6 +122,16 @@ def is_optional_end(self, tagname, next):
125122
'p','pre','section','table','ul')
126123
else:
127124
returntype=="EndTag"ortypeisNone
125+
eliftagname=='option':
126+
# An option element's end tag may be omitted if the option
127+
# element is immediately followed by another option element,
128+
# or if it is immediately followed by an <code>optgroup</code>
129+
# element, or if there is no more content in the parent
130+
# element.
131+
iftype=="StartTag":
132+
returnnext["name"]in ('option','optgroup')
133+
else:
134+
returntype=="EndTag"ortypeisNone
128135
eliftagnamein ('rt','rp'):
129136
# An rt element's end tag may be omitted if the rt element is
130137
# immediately followed by an rt or rp element, or if there is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp