diff --git a/blank.ts b/blank.ts index d161cc2..88a4018 100644 --- a/blank.ts +++ b/blank.ts @@ -477,6 +477,7 @@ interface Context { renames: Array<[number, number, string]>; fullyBlankedRanges: Range[]; dynamicContentOffsets: number[]; + imgSplatOffsets: number[]; effectiveComponentAttrMap?: Map; // When set, `handleBlockStatement` uses the selection from this map // (keyed by the BlockStatement's source-start offset) instead of the @@ -667,6 +668,35 @@ function substituteSelfClosingVoidComponent( // // No-op when no suitable attr area is found — `no-implicit-input-type` // will still fire in that case, but the user can silence per-site. + +// Symmetric to tryInjectInputType but for void natives whose required attrs +// can be supplied by the consumer via `...attributes`. Without injection, +// `` blanks to an attribute-less `` and html-validate +// FP-fires `element-required-attributes` (src) and `wcag/h37` (alt) even +// though both come from the splat at runtime. +// +// We don't rewrite the source — the minimal `...attributes` slot is 13 +// chars and html-validate accepts no two-attr form that fits (bare +// `src alt` triggers `attribute-allowed-values`-missing-value, empty +// quoted `src=''` triggers `attribute-allowed-values`-invalid-value, +// and the wide whitespace form `src=' ' alt=' '` is 19+ chars). +// +// Instead, record the element's start offset; the transformer's +// `processElement` hook reads this list and calls `setAttribute` with +// a DynamicValue at parse time, sidestepping source-side slot width +// entirely. Skipped when the consumer already wrote `src=` / `alt=` +// explicitly (no FP to suppress). +// +// Currently scoped to ; the same shape applies to +// ///