Repository navigation
Parse select content by the current HTML Standard - #50
Merged
Merged
Conversation
The standard parses <select> content in the in-body insertion mode (the customizable-select parser change), so <select><slot></slot></select> keeps its slot. parse5 still implements the retired in-select mode and dropped the slot, so every framework target emitted an empty select. Select tags are parsed under a same-length placeholder name and renamed back until parse5 follows the standard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<select><slot></slot></select>lost its slot at parse time, so every framework target generated an empty<select>(Looma's Select, reported by Knit: authored<option>s never render).The HTML Standard no longer has the "in select" insertion mode: select content is parsed in "in body" as part of the customizable
<select>change (whatwg/html#10557, superseded by #10548), so the slot is kept, as Chrome's parser does. parse5 8.0.1 (the latest) still implements the retired mode and drops it.Until parse5 follows the standard, the source parser parses select tags under a same-length placeholder name (source locations stay exact) and renames them back; the placeholder never leaves the parser.
Test: a slot inside a select reaches the Vue, React, and Svelte output; it fails without the fix. Lint, typecheck, 208 unit tests, 228 target tests pass.