Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#46871 closed enhancement (fixed)

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

Reported by: iamdmitrymayorov's profile iamdmitrymayorov Owned by: sergeybiryukov's profile 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 6 years ago.
46871.2.diff (22.8 KB) - added by iamdmitrymayorov 6 years ago.
Fixes the same issue in other default themes.

Download all attachments as: .zip

Change History (8)

#1 @iamdmitrymayorov
6 years ago

  • Component changed from General to Bundled Theme

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


6 years ago

#3 @SergeyBiryukov
6 years ago

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

@iamdmitrymayorov
6 years ago

Fixes the same issue in other default themes.

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


6 years ago

#5 @ianbelanger
6 years ago

  • Keywords commit added

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

#6 @SergeyBiryukov
6 years 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.