WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/12/2016 07:05:28 AM (3 years ago)
Author:
pento
Message:

Formatting: Add an extra line break before block elements in wpautop().

wpautop() considers double line breaks to be the separator between block level HTML elements. By adding two line breaks before a block element, this allows us to process the text before a block element correctly.

Fixes #4857.

File:
1 edited

Legend:

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

    r38459 r38592  
    470470
    471471    // Add a single line break above block-level opening tags.
    472     $pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n$1", $pee);
     472    $pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee);
    473473
    474474    // Add a double line break below block-level closing tags.
Note: See TracChangeset for help on using the changeset viewer.