Commit 109ffb93 authored by Gary Pendergast's avatar Gary Pendergast

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.

Built from

git-svn-id: 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent a18b133c
......@@ -469,7 +469,7 @@ function wpautop( $pee, $br = true ) {
$allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
// Add a single line break above block-level opening tags.
$pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n$1", $pee);
$pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee);
// Add a double line break below block-level closing tags.
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
......@@ -4,7 +4,7 @@
* @global string $wp_version
$wp_version = '4.7-alpha-38591';
$wp_version = '4.7-alpha-38592';
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment