Make WordPress Core


Ignore:
Timestamp:
01/16/2017 01:05:33 AM (8 years ago)
Author:
azaozz
Message:

Formatting: fix wpautop() to stop adding paragraph tags around <figcaption>.

Fixes #39307 for trunk.

File:
1 edited

Legend:

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

    r39326 r39912  
    505505        $pee = preg_replace( '%\s*([<\[]/(?:audio|video)[>\]])%', '$1', $pee );
    506506        $pee = preg_replace( '%\s*(<(?:source|track)[^>]*>)\s*%', '$1', $pee );
     507    }
     508
     509    // Collapse line breaks before and after <figcaption> elements.
     510    if ( strpos( $pee, '<figcaption' ) !== false ) {
     511        $pee = preg_replace( '|\s*(<figcaption[^>]*>)|', '$1', $pee );
     512        $pee = preg_replace( '|</figcaption>\s*|', '</figcaption>', $pee );
    507513    }
    508514
Note: See TracChangeset for help on using the changeset viewer.