Skip to content

Decompose inline SVG text tokens into native blocks#626

Merged
chubes4 merged 1 commit into
trunkfrom
fix/issue-592-blocks-engine
Jul 18, 2026
Merged

Decompose inline SVG text tokens into native blocks#626
chubes4 merged 1 commit into
trunkfrom
fix/issue-592-blocks-engine

Conversation

@chubes4

@chubes4 chubes4 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recognize classed inline text tokens containing materializable passive SVG artwork
  • decompose supported text runs and SVGs into native paragraph and image children
  • preserve source child order, including SVG-before-text and text-SVG-text tokens
  • retain honest fallback for unsupported descendants or SVGs that require inline document context

Closes #592.

How to test

  1. Check out this branch on a fresh clone.
  2. Run composer --working-dir=php-transformer test:parity.
  3. Confirm all 243 parity fixtures pass.
  4. Run composer --working-dir=php-transformer test.
  5. Confirm the PHP contracts, units, parity suite, and package-install proof pass.

Backwards compatibility

This intentionally changes generated block shape for the bounded recognized case: a classed <span> with supported inline text and passive materializable SVG siblings now becomes a core/group containing ordered core/paragraph and core/image blocks instead of a core/html fallback. Unsupported structures retain their prior fallback path. Consumers that inspect exact generated block arrays for this case should account for the new native shape; no extension paths or public PHP APIs change.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-sol via OpenCode
  • Used for: Investigated representative SSI fallback evidence, implemented the generic native decomposition, reviewed source-order fidelity, and verified the transformer suites. Chris remains responsible for every line.

@chubes4
chubes4 merged commit ca4bd8b into trunk Jul 18, 2026
1 check passed
@chubes4
chubes4 deleted the fix/issue-592-blocks-engine branch July 18, 2026 14:17
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.

Reduce broad core/html fallback containers across the fixture corpus

1 participant