Skip to content

Add inline SVG and iframe to the typed HTML - #1

Merged
quinn-dougherty merged 1 commit into
masterfrom
svg
Sep 26, 2026
Merged

quinn-dougherty merged 1 commit into
masterfrom
svg

Conversation

@quinn-dougherty

Copy link
Copy Markdown
Member

Adds inline SVG and iframe to the typed HTML, so a site can draw diagrams and embed documents without leaving the DSL. Needed by maxvonhippel/FMxAI#4, which renders a proven-correct map as static SVG.

What changed

  • New content category Ctx.svg, with tags svg (flow content, SVG children), g, circle, text (svgText, phrasing children) and SVG's a (svgA), plus iframe. SVG elements are never void: in an HTML document a <circle> without a closing tag would swallow its siblings, so they render with explicit closing tags.
  • Attributes: viewbox (emitted lowercase; the HTML parser's SVG attribute adjustment restores viewBox), cx, cy, r, x, y, fill, stroke, plus loading and crossorigin.
  • HTML and SVG both have an a tag, so the parser now looks tag names up by category: Tag.ofNameIn? c s, with Tag.PlacesIn as the side condition of the inverse lemma. parseNode_el gets the category from its placement witness (placeEl_placesIn); nothing else in the round-trip proof changes.
  • Tests: Tag.ofNameIn? on both as, a document with a map that round-trips, and type-level negatives (SVG a is not flow content; text is not SVG content).

scripts/check.sh passes: build, tests, axiom audit, escape-hatch audit, leanchecker.

🤖 Generated with Claude Code

New content category Ctx.svg with tags svg, g, circle, text and SVG's a, plus iframe and
the attributes they need (viewbox, cx, cy, r, x, y, fill, stroke, loading, crossorigin).
SVG elements are never void so a circle closes explicitly. HTML and SVG both have an a tag,
so the parser looks tag names up by category (Tag.ofNameIn?); the round-trip proof is
unchanged except for supplying the category from the placement witness.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@quinn-dougherty
quinn-dougherty merged commit 2180416 into master Sep 26, 2026
2 checks passed
@quinn-dougherty
quinn-dougherty deleted the svg branch September 26, 2026 16:46
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.

1 participant