WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#38294 closed defect (bug) (fixed)

Visual editor hangs in Chrome and Firefox when a sequence of no-break spaces follows a paragraph

Reported by: greatislander Owned by: azaozz
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.6.1
Component: TinyMCE Keywords:
Focuses: Cc:

Description

Problem

A line of text wrapped in <p> tags followed immediately by ~30 no-break space characters (U+00A0) and additional text causes the visual editor to become unresponsive in Chrome and Firefox on macOS Sierra.

Steps to Reproduce

  1. Insert the following content into the text editor of a post or page (note that the spaces preceding the asterisk are no-break spaces):
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
                               *
  1. Save the post or page.
  1. Switch to the visual editor.

Expected Behaviour

A WYSIWYG version of the content is displayed.

Actual Behaviour

The user receives the error message "The following page has become unresponsive. You can wait for it to become responsive or kill it." (Chrome) or "A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue." (Firefox). In some cases, letting the script continue will eventually load the visual editor properly.

Versions

  • WordPress v4.6.1
  • Twenty Sixteen v1.3
  • PHP 7.0 + MariaDB
  • macOS Sierra 10.12
  • Google Chrome 53.0.2785.143 (64-bit)
  • Firefox 45.0.2

Change History (4)

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.


4 years ago

#2 @azaozz
4 years ago

#38302 was marked as a duplicate.

#3 @azaozz
4 years ago

  • Milestone changed from Awaiting Review to 4.7

Still seems to be caused by "run away" backtracking in the regex that removes empty spaces from empty paragraphs, see #35890.

#4 @azaozz
4 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 39204:

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

Fixes #38294.

Note: See TracTickets for help on using tickets.