From 3e08cf2b66418794863cf40333fdd70078b62c5b Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 13 Sep 2016 06:03:31 +0000 Subject: [PATCH] Formatting: Update `autop()` to match `wpautop()`. [38592] changed the behaviour of `wpautop()` , so it's nice to change `autop()` to match. Interestingly, this change isn't necessary for the functionality to work - #4857 didn't affect content that had been run through `autop()` at some point, as `autop()` would add a single line break before block elements, then `wpautop()` would later add a second line break, making it work correctly. Props nacin for finding out about [38592] on Twitter, and DMing me to remind me to review `autop()`. See #4857. Built from https://develop.svn.wordpress.org/trunk@38594 git-svn-id: http://core.svn.wordpress.org/trunk@38537 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/editor.js | 2 +- wp-admin/js/editor.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index c42611bb2d..e3fbaab945 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -274,7 +274,7 @@ text = text + '\n\n'; text = text.replace( /
\s*
/gi, '\n\n' ); - text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' ); + text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' ); text = text.replace( new RegExp( '()', 'gi' ), '$1\n\n' ); text = text.replace( /]*)?>/gi, '\n\n' ); // hr is self closing block element text = text.replace( /\s*