From 5869cbc05a2bf508427d2da3e31ef34e3f377964 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 18 Sep 2012 17:32:44 +0000 Subject: [PATCH] Synchronize block-level elements between the JS and PHP versions of wpautop. props SergeyBiryukov. fixes #18534. git-svn-id: https://develop.svn.wordpress.org/trunk@21888 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/editor.js | 2 +- wp-includes/formatting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index 1c1d294206..c670cb13a8 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -140,7 +140,7 @@ var switchEditors = { _wp_Autop : function(pee) { var preserve_linebreaks = false, preserve_br = false, - blocklist = 'table|thead|tfoot|tbody|tr|td|th|caption|col|colgroup|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr|noscript|menu|samp|header|footer|article|section|hgroup|nav|aside|details|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|samp|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 f7326d3e79..76e02daf26 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|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|samp|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