Make WordPress Core


Ignore:
Timestamp:
06/28/2019 07:15:31 AM (7 years ago)
Author:
pento
Message:

Formatting: Add correct <p> tags near <hr> tags.

It can be tricky to know when wpautop() should add <p> tags, but one thing we can be certain about is that they really shouldn't be anywhere near <hr> tags.

Now they aren't.

Props solarissmoke, MattyRob, pento.
Fixes #14674.

File:
1 edited

Legend:

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

    r45573 r45574  
    500500        // Add a double line break below block-level closing tags.
    501501        $pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
     502
     503        // Add a double line break after hr tags, which are self closing.
     504        $pee = preg_replace( '!(<hr\s*?/?>)!', "$1\n\n", $pee );
    502505
    503506        // Standardize newline characters to "\n".
Note: See TracChangeset for help on using the changeset viewer.