Make WordPress Core

Opened 8 weeks ago

Closed 8 weeks ago

Last modified 8 weeks ago

#61655 closed defect (bug) (duplicate)

HTML API: Audit modified class_name whitespace handling

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

When the HTML API modifies the class property via some of the class name oriented methods, the resulting whitespace may be inconsistent. For example, trailing whitespace is trimmed while leading whitespace is removed.

Audit this behavior to ensure it is clear and consistent.

See this Slack conversation for some discussion.

Change History (5)

This ticket was mentioned in PR #6933 on WordPress/wordpress-develop by @jonsurrell.


8 weeks ago
#1

  • Keywords has-patch has-unit-tests added

The HTML API remove_class regarding white space opts to maintain "inter-class" whitespace.

https://github.com/WordPress/wordpress-develop/blob/5effffccd005ca3dae6631ee73b1096b8f54a861/src/wp-includes/html-api/class-wp-html-tag-processor.php#L2223-L2230

This seems reasonable and justified, but normalization seems inconsistent. Leading space is maintained, but trailing space is not.

It seems more consistent to trim leading and trailing space, and actually maintain _only_ inter-class whitespace.

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

@jonsurrell commented on PR #6933:


8 weeks ago
#3

@dmsnell How do you feel about moving ahead with this now?

#4 @jonsurrell
8 weeks ago

  • Milestone 6.7 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #61531.

Note: See TracTickets for help on using tickets.