Make WordPress Core

Changeset 39204


Ignore:
Timestamp:
11/11/2016 11:06:03 PM (8 years ago)
Author:
azaozz
Message:

TinyMCE: fix freezing the editor when wpautop is disabled and a paragraph starts with a lot of white space characters.

Fixes #38294.

File:
1 edited

Legend:

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

    r38997 r39204  
    132132
    133133            // Remove spaces from empty paragraphs.
    134             // Avoid backtracking, can freeze the editor. See #35890.
    135             // (This is also quite faster than using only one regex.)
     134            // Try to avoid a lot of backtracking, can freeze the editor. See #35890 and #38294.
    136135            event.content = event.content.replace( /<p>([^<>]+)<\/p>/gi, function( tag, text ) {
    137                 if ( /^(&nbsp;|\s|\u00a0|\ufeff)+$/i.test( text ) ) {
     136                if ( text === '&nbsp;' || ! /\S/.test( text ) ) {
    138137                    return '<p><br /></p>';
    139138                }
Note: See TracChangeset for help on using the changeset viewer.