mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 23:41:38 +01:00
Editor: When stripping paragraph tags, and there is a <br> at the beginning or the end, merge them and keep the paragraph, not the <br>.
Props rellect. Fixes #37066. Built from https://develop.svn.wordpress.org/trunk@40787 git-svn-id: http://core.svn.wordpress.org/trunk@40645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b398ccf2a1
commit
d7c37de2de
@ -224,8 +224,14 @@ window.wp = window.wp || {};
|
|||||||
// Normalize white space chars and remove multiple line breaks.
|
// Normalize white space chars and remove multiple line breaks.
|
||||||
html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
|
html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
|
||||||
|
|
||||||
// Rrplace <br> tags with a line break.
|
// Replace <br> tags with line breaks.
|
||||||
html = html.replace( /\s*<br ?\/?>\s*/gi, '\n' );
|
html = html.replace( /(\s*)<br ?\/?>\s*/gi, function( match, space ) {
|
||||||
|
if ( space && space.indexOf( '\n' ) !== -1 ) {
|
||||||
|
return '\n\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '\n';
|
||||||
|
});
|
||||||
|
|
||||||
// Fix line breaks around <div>.
|
// Fix line breaks around <div>.
|
||||||
html = html.replace( /\s*<div/g, '\n<div' );
|
html = html.replace( /\s*<div/g, '\n<div' );
|
||||||
|
2
wp-admin/js/editor.min.js
vendored
2
wp-admin/js/editor.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.8-beta1-40786';
|
$wp_version = '4.8-beta1-40787';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user