Skip to content

fix: materialize sanitized inline SVG styles - #1033

Merged
chubes4 merged 1 commit into
trunkfrom
fix/issue-53-blocks-engine
Aug 22, 2026
Merged

fix: materialize sanitized inline SVG styles#1033
chubes4 merged 1 commit into
trunkfrom
fix/issue-53-blocks-engine

Conversation

@chubes4

@chubes4 chubes4 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Materialize passive inline SVGs containing sanitizer-removed style elements as native core/image assets.
  • Preserve local symbol/use artwork after sanitization, while retaining external sprite references as bounded fallbacks.
  • Add parity and WordPress parse/serialize/render coverage for the nested-symbol path.

Root Cause

The native-image classifier evaluated the source DOM before sanitization. Puffin self-contained vectors commonly place a style element inside defs; although sanitization removes that style, the pre-sanitization classifier rejected the complete SVG and routed it to core/html instead of the materialized image path.

Verification

  • php php-transformer/tests/parity/run.php
  • composer --working-dir=php-transformer test
  • php php-transformer/tests/integration/wordpress-site-plan.php (skipped locally because WP_TESTS_DIR is unavailable; the real WordPress assertion runs in configured test environments)
  • git diff --check

Fixes #53

AI assistance

OpenAI GPT-5.6-sol via OpenCode general coding subagent. Used to inspect the corpus and transformer paths, implement the scoped classifier correction, and add regression coverage; Chris remains responsible for the change.

@chubes4
chubes4 merged commit a989fde into trunk Aug 22, 2026
4 checks passed
@chubes4
chubes4 deleted the fix/issue-53-blocks-engine branch August 22, 2026 22:02
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.

Preserve safe inline SVG icons during HTML-to-block conversion

1 participant