diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index 675ffd94b0..bd71cc87bd 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -138,7 +138,7 @@ var switchEditors = { _wp_Autop : function(pee) { var preserve_linebreaks = false, preserve_br = false, - blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|samp|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary'; + blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary'; if ( pee.indexOf('/g, function(a){ diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 6ba28c7b68..792b478df8 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -220,7 +220,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|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|samp|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; + $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|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 diff --git a/wp-includes/js/tinymce/wp-tinymce-schema.js b/wp-includes/js/tinymce/wp-tinymce-schema.js index e2a05d8791..411e5d774c 100644 --- a/wp-includes/js/tinymce/wp-tinymce-schema.js +++ b/wp-includes/js/tinymce/wp-tinymce-schema.js @@ -441,7 +441,7 @@ textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside nav figure'); blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + - 'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap); + 'th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup', textBlockElementsMap); // Converts a wildcard expression string to a regexp for example *a will become /.*a/. function patternToRegExp(str) {