diff --git a/src/wp-admin/js/editor.js b/src/wp-admin/js/editor.js index 03187d9771..0a3437c7b9 100644 --- a/src/wp-admin/js/editor.js +++ b/src/wp-admin/js/editor.js @@ -224,8 +224,14 @@ window.wp = window.wp || {}; // Normalize white space chars and remove multiple line breaks. html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' ); - // Rrplace
tags with a line break. - html = html.replace( /\s*
\s*/gi, '\n' ); + // Replace
tags with line breaks. + html = html.replace( /(\s*)
\s*/gi, function( match, space ) { + if ( space && space.indexOf( '\n' ) !== -1 ) { + return '\n\n'; + } + + return '\n'; + }); // Fix line breaks around
. html = html.replace( /\s*