diff --git a/src/wp-admin/js/editor.js b/src/wp-admin/js/editor.js index 0b3e04b2cd..4ff70df848 100644 --- a/src/wp-admin/js/editor.js +++ b/src/wp-admin/js/editor.js @@ -211,7 +211,7 @@ window.switchEditors = { preserve_br = false, blocklist = '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|details|menu|summary'; + '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary'; if ( pee.indexOf( '/g, function( a ) { diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index c4f7614457..f8d1e74264 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -405,7 +405,7 @@ function wpautop($pee, $br = true) { $pee = preg_replace('|
\s*
|', "\n\n", $pee); // Space things out a little - $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|details|menu|summary)'; + $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)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!()!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines