WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 11 months ago

#35890 closed defect (bug) (fixed)

TinyMCE downs with the given piece of html text

Reported by: Elvin.Haci Owned by: azaozz
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.4.2
Component: TinyMCE Keywords:
Focuses: Cc:

Description

Hello. I have a small piece of text which causes TinyMce stopping (entire editor page becomes unaavailable)

Just paste the attached text to TEXT tab of wp editor, then try to switch Visual tab. The page will become unavailable.

I have tested this bug with 3 websites and 2 browsers - the problem is common, not specific.

Attachments (1)

bug.html (5.2 KB) - added by Elvin.Haci 20 months ago.
paste the html text to TEXT tab of wp editor of wp-admin

Download all attachments as: .zip

Change History (5)

@Elvin.Haci
20 months ago

paste the html text to TEXT tab of wp editor of wp-admin

#1 @Elvin.Haci
20 months ago

p.s. i have also found the main reason of the problem.
Long empty spaces before "3GPP Long Term Evolution" string in text causes the problem. If remove it, it will work.

#2 @azaozz
20 months ago

  • Component changed from Editor to TinyMCE
  • Milestone changed from Awaiting Review to 4.5

Confirmed. Happens only when wpautop is disabled and there are many U+00A0 (UTF-8 for &nbsp;) between the opening <p> tag and an inline tag like the <strong> in the example. This will hang it:

<p>                                                                                     <strong>Lorem ipsum dolor sit amet consectetuer at Nullam velit Aenean In.</strong></p>

Caused by the regexp for removing the space chars from empty paragraphs in the "wordpress" plugin: https://core.trac.wordpress.org/browser/tags/4.4.2/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js#L119.

Fix coming up.

#3 @azaozz
20 months ago

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

In 36597:

TinyMCE: fix the regex that removes spaces from empty paragraphs. Was causing problems when wpautop is disabled and there are many U+00A0 chars between the opening <p> and an inline tag. These chars are inserted by the browsers to maintain consecutive spaces typed by the users in contentEditable.

Fixes #35890.

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


11 months ago

Note: See TracTickets for help on using tickets.