Skip to content

Navigation Menu

Sign in
Sign up

fix: Don’t report errors for omissible </option> end tag - #125

Open
sideshowbarker wants to merge 1 commit into
master from
option-generateImpliedEndTagsExceptFor
Open

fix: Don’t report errors for omissible </option> end tag #125
sideshowbarker wants to merge 1 commit into
master from
option-generateImpliedEndTagsExceptFor

Conversation

@sideshowbarker

@sideshowbarker sideshowbarker commented Jul 31, 2026
edited
Loading

Copy link
Copy Markdown
Member

Problem: We unexpectedly reported errors for omitted </option> end tags in cases where the spec allows omitting them. See validator/validator#2116.

Cause: The spec’s "any other end tag" case for the "in body" insertion mode requires generating implied end tags "except for HTML elements with the same tag name as the token". But we didn’t implement that exception. Specifically, we called generateImpliedEndTags() if tag name is "option" but should instead call generateImpliedEndTagsExceptFor("option").

Fix: Call generateImpliedEndTagsExceptFor("option") instead.

Problem: We unexpectedly reported errors for omitted </option> end tags
in cases where the spec allows omitting them.
Cause: The spec’s "any other end tag" case for the "in body" insertion
mode requires generating implied end tags "except for HTML elements with
the same tag name as the token". But we didn’t implement that exception.
Specifically, we called generateImpliedEndTags() if tag name is "option"
but should instead call generateImpliedEndTagsExceptFor("option").
Fix: Call generateImpliedEndTagsExceptFor("option") instead.
@sideshowbarker sideshowbarker changed the title (削除) fix(htmlparser): Don’t report errors for omissible </option> end tag (削除ここまで) (追記) fix: Don’t report errors for omissible </option> end tag (追記ここまで) Jul 31, 2026

tenzap commented Aug 4, 2026
edited
Loading

Copy link
Copy Markdown

Please consider merging this since in Debian we depend on this htmlparser repo for the vnu validator package. And test now fails as long as this is not fixed in this htmlparser repo.

"file:tests/html/elements/option/omitted-end-tag-before-optgroup-isvalid.html":7:11: error: End tag "optgroup" seen, but there were open elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hsivonen hsivonen Awaiting requested review from hsivonen

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /