Skip to content

Deduplicate generated block class attrs#575

Merged
chubes4 merged 1 commit into
trunkfrom
fix/paragraph-class-dedupe
Jul 7, 2026
Merged

Deduplicate generated block class attrs#575
chubes4 merged 1 commit into
trunkfrom
fix/paragraph-class-dedupe

Conversation

@chubes4

@chubes4 chubes4 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Normalize block className attrs at the serializer boundary to strip generated Gutenberg classes and duplicate class tokens before comment attrs and saved HTML are produced.
  • Preserve custom source classes such as hero-tagline while letting block support emit generated classes like has-text-color exactly once.
  • Add contract coverage for the Coffee-style duplicate has-text-color paragraph mismatch through both full HTML transform and direct BlockFactory usage.

Evidence

  • Lab blocker evidence run: 55267331-ad9c-4a71-9a41-be7cb9254c95.
  • Before: 4 editor invalids; affected fixtures were 2-onepager-coffee, 3-artist-music (2 blocks), and 31-personal-cv-academic; snippets showed core/paragraph class mismatches like has-text-color has-text-color hero-tagline.
  • After focused local fixture validation: 2-onepager-coffee, 3-artist-music, 31-personal-cv-academic, and 15-saas all report wp_block_validity=pass, 0 findings, 0 duplicate has-text-color, and 0 core/html fallback blocks.
  • composer test:canonical
  • composer test (includes 229 PHP transformer parity fixtures)

AI assistance

  • AI assistance: Yes
  • Tool(s): GPT-5.5 via OpenCode
  • Used for: Investigated Lab artifacts, mapped the invalid paragraph mismatch to generated class leakage, implemented the serializer fix and regression coverage, and ran verification.

@chubes4 chubes4 merged commit 67fe7dd into trunk Jul 7, 2026
1 check passed
@chubes4 chubes4 deleted the fix/paragraph-class-dedupe branch July 7, 2026 01:54
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