Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rich-text source support for WordPress 6.5 #58

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

alecgeatches
Copy link
Contributor

@alecgeatches alecgeatches commented Mar 19, 2024

Description

See @leoloso's original PR in #57 (extended here) and the related Gutenberg PR: WordPress/gutenberg#43204.

The majority of html source type blocks have been converted to use rich-text. The main difference between html and rich-text seems to be that html supports multiline selectors, and rich-text has a different __unstablePreserveWhiteSpace supported setting.

The rich-text-specific __unstablePreserveWhiteSpace attribute is not currently implemented in the parser for a couple of reasons:

  1. It's __unstable, which we don't currently use in any other parsing. If this attribute is standardized without the __unstable prefix, we should support this option.
  2. This is only used in 3 blocks (<code>, <pre> and verse) to preserve copied newlines at present.

Steps to Test

This PR adds tests for rich-text attribute sources. Tests can be run via wp-env and composer:

wp-env start
composer install
composer run test

@alecgeatches alecgeatches self-assigned this Mar 19, 2024
@alecgeatches alecgeatches requested a review from a team as a code owner March 19, 2024 16:25
@alecgeatches alecgeatches changed the base branch from trunk to planned-release/1.2.1 March 19, 2024 17:08
@alecgeatches alecgeatches merged commit 32f74d7 into planned-release/1.2.1 Mar 19, 2024
2 checks passed
@alecgeatches alecgeatches deleted the add/rich-text branch March 19, 2024 17:09
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