Skip to content

fix(idrx): allow iframe attributes in markup validator#3

Merged
vcombey merged 1 commit into
mainfrom
fix/idrx-iframe-attributes
Jun 16, 2026
Merged

fix(idrx): allow iframe attributes in markup validator#3
vcombey merged 1 commit into
mainfrom
fix/idrx-iframe-attributes

Conversation

@Lazare-42

Copy link
Copy Markdown
Collaborator

Problem

A literal <iframe> carrying sandbox/allow attributes fails to compile in inline/production mode with a cryptic error:

Error: While processing right hand side of showView.
When unifying:  String -> Elab Html
and:            Elab ?scriptTy
Mismatch between: String -> Elab Html and Elab ?scriptTy.

Root cause

The idrx view macro validates element attributes against knownHtmlAttributes when checkMarkup is enabled (the default). The iframe-specific attributes sandbox, allow, allowfullscreen, and srcdoc were 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 ?scriptTy type 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:

, "sandbox", "allow", "allowfullscreen", "srcdoc"

Fixes #2.

🤖 Generated with Claude Code

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]>
@vcombey vcombey merged commit 4f0303e into main Jun 16, 2026
0 of 2 checks passed
@vcombey vcombey deleted the fix/idrx-iframe-attributes branch June 28, 2026 15:06
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.

idrx macro fails to elaborate a literal <iframe> in inline (production) mode

2 participants