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

fix: Correctly parse nested attribute and tag sources. #293

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

justlevine
Copy link
Contributor

@justlevine justlevine commented Sep 23, 2024

What

This PR fixes an issue with nested attributes (such as those used by CoreTable) not being resolved correctly.

More specifically, it:

  • Ensures ::parse_attribute() is called correctly regardless of if there is a selector present.
  • Adds support for parsing tag sources
  • Removes the unnecessary `::parse_single_source()

Additionally, tests have been backfilled specific CoreTable attributes.

Why

Fixes #282

Test Coverage

Important

This PR is based on #284 which should be merged first.

Relevant diff 1192a61

Covered CoreTableAttributes

  • align
  • backgroundColor
  • borderColor
  • caption
  • className
  • fontFamily
  • fontSize
  • gradient
  • hasFixedLayout
  • lock
  • style
  • textColor
  • head
  • foot
  • body

Not covered

  • CoreTableAttributes.metadata

Additional notes:

The new DOMHelpers::get_first_node_tag_name() is marked as internal, because the entire class needs to be reworked (and ideally replaced with WordPress's HTML parsing api ).

@justlevine justlevine requested a review from a team as a code owner September 23, 2024 16:27
Copy link

changeset-bot bot commented Sep 23, 2024

🦋 Changeset detected

Latest commit: 8531653

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

This PR includes changesets to release 1 package
Name Type
@wpengine/wp-graphql-content-blocks 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

@justlevine justlevine changed the title tests: backfill tests for CoreTable attributes fix: Correctly parse nested attribute and tag sources. Sep 23, 2024
@theodesp
Copy link
Member

Ta!

@theodesp theodesp merged commit 3a1157b into wpengine:main Sep 26, 2024
10 of 11 checks passed
@justlevine justlevine deleted the tests/core-table-backfill branch October 18, 2024 10:30
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.

Bug: CoreTable doesn't return most data for fields
2 participants