Skip to content

Conversation

@rleeson
Copy link
Contributor

@rleeson rleeson commented Dec 23, 2024

Description of the Change

A couple issues were identified with HeadstartWP's WordPress plugin side:

  1. Attributes on synced block patterns were being overwritten with core/block instead of the correct inner blocks, as well as nesting any block past the first in a Synced pattern underneath the first block. <h2></h2><h3></h3><p></p> => <h2><h3></h3><p></p></h2>
  2. Could not process multi-byte encoded characters

How to test the Change

Synced Patterns

  1. Add a Block Pattern to any page with more than one block in it, ensure the Synced checkbox is enabled.
  2. Save the Post and view the page on the REST API to ensure the Synced Pattern in content.rendered shows as the correct blocks with correct data-wp-block-name and that they are not inappropriately nested.

Multibyte Characters

  1. Include a block like following on a page:
    <!-- wp:paragraph -->
    <p>The temperature is 23°C ☀️ (sun emoji) and © (copyright symbol). HTML entity for Degrees: &#176;.</p>
    <!-- /wp:paragraph -->
    
  2. Ensure the content show properly encoded on the REST API.

Changelog Entry

Added - Improved tests for the Gutenberg block attribute processing
Fixed - Gutenberg post content block attribute processing for Synced Patterns and support for multibyte characters.

Credits

Props @rleeson

Checklist:

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2024

🦋 Changeset detected

Latest commit: 98b66bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@headstartwp/headstartwp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headstartwp-app-router ❌ Failed (Inspect) Dec 23, 2024 6:13pm
headstarwp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 6:13pm

Copy link
Member

@nicholasio nicholasio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks solid!

@nicholasio nicholasio merged commit 07d0325 into trunk Dec 23, 2024
12 of 14 checks passed
@nicholasio nicholasio deleted the fix/block-processor-dom-document branch December 23, 2024 18: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.

2 participants