Carry standalone form-control inputs as runtime islands (clears unsupported_input)#244
Merged
Merged
Conversation
… as runtime islands Standalone <input> elements that have no faithful native block or readable static approximation (file/hidden/color/date-style inputs, or any control with inline event handlers) previously fell through to the unsupported-element fallback, producing an unacceptable unsupported_element_loss (the unsupported_input pattern family). The corpus survey showed this as the only remaining html_unsupported_element input family: 6 occurrences across 6 website fixtures, all hidden JSON-import file pickers driven by client scripts. These controls genuinely depend on a client runtime and, when hidden, have no visual representation. Forcing a static paragraph approximation would be wrong. Instead, after the readable-control and search paths decline, preserve the control as a bounded runtime island: the source markup is carried in the island snippet so behavior can be re-attached, no misleading static block is emitted, and the outcome is the acceptable runtime_island_preserved loss class rather than unsupported_element_loss. Corpus impact: unsupported_input 6 -> 0; html_unsupported_element 53 -> 47; unsupported_element_loss total 53 -> 47. Adds a dedicated parity fixture asserting the runtime-island outcome and acceptable loss class. Change is additive and localized to input handling to merge cleanly with the in-flight figure/long-tail coverage PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds deterministic coverage for standalone
<input>(and<select>/<textarea>) elements outside a<form>, eliminating the lastunsupported_input/html_unsupported_elementfamily from the corpus.Driven by the corpus survey: all 6
unsupported_inputoccurrences (6 fixtures) were the same kind — hidden<input type="file">JSON-import pickers driven by client scripts (e.g.58-infinite-whiteboard,59-spreadsheet,64-kanban-board). They are invisible (hidden/display:none/aria-hidden), reached thehtml_unsupported_elementcatch-all, and produced an UNACCEPTABLEunsupported_element_loss.Change (
src/HtmlToBlocks/HtmlTransformer.php)preserveStandaloneFormControlAsRuntimeIsland(), hooked intoconvertElementafter the readable-control / search paths decline and before the unsupported fallback. For standalone non-readable controls (file/hidden/color/date, or any control carrying inline event handlers) it records a runtime island (control,form_control_requires_runtime) with the source markup carried, and emits no misleading static text.preserved_runtime_island(ACCEPTABLE, with the runtime carried) instead ofunsupported_element_loss.core/paragrapheditable_approximation orcore/searchnative_conversion.Verification
composer test+composer parity→ green, 126 fixtures (+1 new:html-standalone-input-runtime-island-preserved.json, asserting 0 blocks / 0 fallbacks, acontrolruntime island with carried snippet,loss_class = runtime_island_preserved).unsupported_inputfamily 6 → 0;html_unsupported_elementoverall 53 → 47 (remaining 47 are figure/marquee/noscript/blink/label, covered by PR Add deterministic figure + long-tail static-tag coverage #236).AI assistance