Skip to content

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

Open
sideshowbarker wants to merge 1 commit into
masterfrom
option-generateImpliedEndTagsExceptFor
Open

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

Conversation

@sideshowbarker

@sideshowbarker sideshowbarker commented Jul 31, 2026

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
@sideshowbarker
sideshowbarker requested a review from hsivonen July 31, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant