fix(idrx): allow iframe attributes in markup validator#3
Merged
Conversation
The idrx view macro validates element attributes against knownHtmlAttributes when checkMarkup is on (the default in inline/production mode). The iframe-specific attributes sandbox, allow, allowfullscreen and srcdoc were missing from the list, so a literal <iframe> with sandbox/allow attributes was rejected during elaboration. Because the rejection surfaces as a macro failure, it rendered as a cryptic "Mismatch between String -> Elab Html and Elab ?scriptTy" error rather than an "unknown attribute" message. Dev-runtime mode skips the macro/validation entirely, which is why only production builds tripped on it. Fixes #2. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Problem
A literal
<iframe>carryingsandbox/allowattributes fails to compile in inline/production mode with a cryptic error:Root cause
The idrx view macro validates element attributes against
knownHtmlAttributeswhencheckMarkupis enabled (the default). The iframe-specific attributessandbox,allow,allowfullscreen, andsrcdocwere missing from that list, so the markup was rejected during elaboration.Because the rejection is raised from inside the elaborator, it surfaces as the misleading
Elab ?scriptTytype mismatch rather than a clear "unknown attribute" message. The dev-runtime mode skips the macro and its validation entirely, which is why only production builds were affected.Fix
Add the missing iframe attributes to
knownHtmlAttributes:Fixes #2.
🤖 Generated with Claude Code