Make WordPress Core


Ignore:
Timestamp:
11/16/2021 07:40:36 PM (2 years ago)
Author:
hellofromTonya
Message:

Formatting: Add additional support for single and nestable tags in force_balance_tags().

Adds track and wbr support for single tags.

Adds article, aside, details, figure, and section for nestable tags.

Updates tests.

Follow-up to [5805], [21828], [45929].

Props glendaviesnz, costdev, talldanwp, ramonopoly, sergeybiryukov.
Fixes #50225.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r52132 r52188  
    25152515    $newtext   = '';
    25162516    // Known single-entity/self-closing tags.
    2517     $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );
     2517    $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source', 'track', 'wbr' );
    25182518    // Tags that can be immediately nested within themselves.
    2519     $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
     2519    $nestable_tags = array( 'article', 'aside', 'blockquote', 'details', 'div', 'figure', 'object', 'q', 'section', 'span' );
    25202520
    25212521    // WP bug fix for comments - in case you REALLY meant to type '< !--'.
Note: See TracChangeset for help on using the changeset viewer.