WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 days ago

#54130 new defect (bug)

force_balance_tags breaks new gallery block

Reported by: glendaviesnz Owned by:
Milestone: 5.9 Priority: normal
Severity: major Version: trunk
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

The refactored gallery block uses a nested <figure><figure></figure></figure> structure, as recommended by w3c for image collections.

If a site has the use_balanceTags option set to 1, then the Gallery block breaks on save as force_balance_tags restructures it from <figure><figure></figure></figure> to <figure></figure><figure></figure>.

This is because figure is not listed as a directly nestable element at https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php#L2485

Change History (6)

This ticket was mentioned in PR #1678 on WordPress/wordpress-develop by glendaviesnz.


5 weeks ago

  • Keywords has-patch added

The refactored gallery block uses a nested <figure><figure></figure></figure> structure, as recommended by w3c for image collections.

If a site has the use_balanceTags option set to 1, then the Gallery block breaks on save as force_balance_tags restructures it from <figure><figure></figure></figure> to <figure></figure><figure></figure>.

This PR adds figure as as a directly nestable element, which it is under the current html specs.

Trac ticket: https://core.trac.wordpress.org/ticket/54130

#2 @SergeyBiryukov
5 weeks ago

  • Component changed from Gallery to Formatting
  • Milestone changed from Awaiting Review to 5.9

#3 @prbot
2 weeks ago

talldan commented on PR #1678:

@glendaviesnz There are some unit tests for balanceTags. It looks like all that needs to be done is update this array for this change to be covered:
https://github.com/WordPress/wordpress-develop/blob/de822e8fb02e65bea74e9fa75b889461ef234bb3/tests/phpunit/tests/formatting/balanceTags.php#L8-L16

#4 @prbot
2 weeks ago

talldan commented on PR #1678:

@glendaviesnz There are some unit tests for balanceTags. It looks like all that needs to be done is update this array for this change to be covered:
https://github.com/WordPress/wordpress-develop/blob/de822e8fb02e65bea74e9fa75b889461ef234bb3/tests/phpunit/tests/formatting/balanceTags.php#L8-L16

#5 @prbot
2 weeks ago

glendaviesnz commented on PR #1678:

There are some unit tests for balanceTags. It looks like all that needs to be done is update this array for this change to be covered:

Thanks, have update the test.

This ticket was mentioned in Slack in #core-editor by glendaviesnz. View the logs.


5 days ago

Note: See TracTickets for help on using tickets.