WordPress.org

Make WordPress Core

Changeset 33461


Ignore:
Timestamp:
07/28/2015 02:11:04 PM (5 years ago)
Author:
markjaquith
Message:

Fill empty TinyMCE paragraphs with a dummy <br /> on all browsers.

fixes #33151
props iseulde

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r33430 r33461  
    9393    // Replace Read More/Next Page tags with images
    9494    editor.on( 'BeforeSetContent', function( event ) {
    95         var title,
    96             paragraph = tinymce.Env.webkit ? '<p><br /></p>' : '<p></p>';
     95        var title;
    9796
    9897        if ( event.content ) {
     
    114113            }
    115114
    116             // Remove spaces from empty paragraphs.
    117             event.content = event.content.replace( /<p>(?:&nbsp;|\u00a0|\uFEFF|\s)+<\/p>/gi, paragraph );
    118 
    119115            if ( event.load && event.format !== 'raw' && hasWpautop ) {
    120116                event.content = wp.editor.autop( event.content );
    121117            }
     118
     119            // Remove spaces from empty paragraphs.
     120            event.content = event.content.replace( /<p>(?:&nbsp;|\u00a0|\uFEFF|\s)+<\/p>/gi, '<p><br /></p>' );
    122121        }
    123122    });
Note: See TracChangeset for help on using the changeset viewer.