Ticket #28282: 28282.2.patch
| File 28282.2.patch, 1.2 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
348 348 } 349 349 350 350 // Keep empty paragraphs :( 351 e.content = e.content.replace( /<p>( <br ?\/?>|\u00a0|\uFEFF)?<\/p>/g, '<p> </p>' );351 e.content = e.content.replace( /<p>(?:<br ?\/?>|\ufeff|\s)+?<\/p>/g, '<p> </p>' ); 352 352 353 353 if ( editor.getParam( 'wpautop', true ) && typeof window.switchEditors !== 'undefined' ) { 354 354 e.content = window.switchEditors.pre_wpautop( e.content ); 355 355 } 356 356 }); 357 357 358 // Remove spaces from empty paragraphs. 359 editor.on( 'BeforeSetContent', function( event ) { 360 if ( event.content ) { 361 event.content = event.content.replace( /<p>(?: |\ufeff|\s)+<\/p>/gi, '<p></p>' ); 362 } 363 }); 364 358 365 editor.on( 'preInit', function() { 359 366 // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty 360 367 editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' );