From 2950eb8ea209d87197098f4bac0873cd03986d16 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 13 Sep 2016 06:02:23 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@38594 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/js/editor.js b/src/wp-admin/js/editor.js index c42611bb2d..e3fbaab945 100644 --- a/src/wp-admin/js/editor.js +++ b/src/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*