WordPress.org

Make WordPress Core

Opened 2 weeks ago

Closed 8 days ago

#46871 closed enhancement (fixed)

Twenty Nineteen: Fix inconsistent HTML comments after closing HTML tags.

Reported by: iamdmitrymayorov Owned by: SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Some comments after HTML closing tags are either incorrect or inconsistent. I first discovered one in header.php.

Should be:

<div class="site-branding-container">
        <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</div><!-- .site-branding-container -->

Was:

<div class="site-branding-container">
        <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</div><!-- .layout-wrap -->

After that I checked comments after closing HTML tags in all theme files and found another incorrect one in template-parts/header/entry-header.php. Should be <!-- .entry-meta --> but was <!-- .meta-info -->.

Lastly, some comments that are placed right after the tags that have dynamic IDs were inconsistent. I've found three versions <!-- #post-## -->, <!-- #post-${ID} -->, and <!-- #post-<?php the_ID(); ?> -->. The last one actually prints the ID in HTML. I have updated all occurrences to use <!-- #post-<?php the_ID(); ?> --> for consistency.

Attachments (2)

46871.diff (3.3 KB) - added by iamdmitrymayorov 2 weeks ago.
46871.2.diff (22.8 KB) - added by iamdmitrymayorov 13 days ago.
Fixes the same issue in other default themes.

Download all attachments as: .zip

Change History (8)

#1 @iamdmitrymayorov
2 weeks ago

  • Component changed from General to Bundled Theme

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


13 days ago

#3 @SergeyBiryukov
13 days ago

  • Milestone changed from Awaiting Review to 5.2
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

@iamdmitrymayorov
13 days ago

Fixes the same issue in other default themes.

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


8 days ago

#5 @ianbelanger
8 days ago

  • Keywords commit added

Thanks for your patches @iamdmitrymayorov, everything looks good to me. Marking for commit

#6 @SergeyBiryukov
8 days ago

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

In 45209:

Bundled Themes: Use consistent HTML comments after closing HTML tags.

Props iamdmitrymayorov.
Fixes #46871.

Note: See TracTickets for help on using tickets.