TinyMCE: pad empty paragraphs with `<br>` in Chrome to stop it from inserting non-breaking spaces in them.
Props iseulde. Fixes #31255. Built from https://develop.svn.wordpress.org/trunk@31878 git-svn-id: http://core.svn.wordpress.org/trunk@31857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4b3e47a843
commit
990f1b43a8
|
@ -394,8 +394,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
|
|
||||||
// Remove spaces from empty paragraphs.
|
// Remove spaces from empty paragraphs.
|
||||||
editor.on( 'BeforeSetContent', function( event ) {
|
editor.on( 'BeforeSetContent', function( event ) {
|
||||||
|
var paragraph = tinymce.Env.webkit ? '<p><br /></p>' : '<p></p>';
|
||||||
|
|
||||||
if ( event.content ) {
|
if ( event.content ) {
|
||||||
event.content = event.content.replace( /<p>(?: |\u00a0|\uFEFF| )+<\/p>/gi, '<p></p>' );
|
event.content = event.content.replace( /<p>(?: |\u00a0|\uFEFF|\s)+<\/p>/gi, paragraph );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-beta2-31877';
|
$wp_version = '4.2-beta2-31878';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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