Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56457 closed enhancement (fixed)

WPCS: Self closing tags are not property closed.

Reported by: haritpanchal's profile haritpanchal Owned by: audrasjb's profile audrasjb
Milestone: 6.1 Priority: normal
Severity: minor Version:
Component: Administration Keywords: has-patch
Focuses: coding-standards Cc:

Description

All tags must be properly closed. For tags that are self-closing, the forward slash should have exactly one space preceding it. I found several <br /> tags closed improperly as <br/>. According to coding standards, it should close in <br /> aw

Attachments (1)

56457.patch (8.0 KB) - added by haritpanchal 2 years ago.
Patch Added

Download all attachments as: .zip

Change History (10)

@haritpanchal
2 years ago

Patch Added

#1 @haritpanchal
2 years ago

  • Keywords has-patch added; needs-patch removed

#2 @costdev
2 years ago

  • Focuses docs removed
  • Milestone changed from Awaiting Review to 6.1
  • Severity changed from major to minor
  • Version 6.0.1 deleted

For tags that are self-closing, the forward slash should have exactly one space preceding it:
<br /> rather than the compact but incorrect: <br>

HTML Coding Standards - Self-closing Elements

  • Removing Version as the patch touches lines added across multiple versions of WordPress.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 years ago

#4 @audrasjb
2 years ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Reviewed during today's bug scrub.

It would be nice to run unit tests on this before commit, just in case some html content/strings are used by existing unit tests.

Self assigning for unit tests run and (most probably) commit

#6 @audrasjb
2 years ago

The above PR addresses a missed occurence in wp-includes/media-template.php.

#7 @audrasjb
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 54062:

Coding Standards: Use a consistent markup for line break tags across Core.

This changeset replaces <br/> with <br /> on various places, as per WordPress Coding Standards.
See https://developer.wordpress.org/coding-standards/wordpress-coding-standards/html/#self-closing-elements

Props haritpanchal, costdev, audrasjb.
Fixes #56457.

#9 @afragen
2 years ago

Related #56647

Note: See TracTickets for help on using tickets.