Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#44308 closed defect (bug) (fixed)

TinyMCE: empty paragraphs are created from HTML comments on separate lines

Reported by: azaozz Owned by: azaozz
Priority: normal Milestone: 4.9.7
Component: TinyMCE Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Follow up from https://github.com/WordPress/gutenberg/issues/6385. To test: http://fiddle.tinymce.com/Ctgaab/5.

To fix this we will need to remove any line breaks from between HTML comments, and insert them again (when wpautop is disabled).

Attachments (1)

44308.patch (1.1 KB ) - added by azaozz 8 years ago.

Download all attachments as: .zip

Change History (6)

@azaozz
8 years ago

#1 @azaozz
8 years ago

In 44308.patch:

  • Remove any white space between two or more HTML comments when wpautop is not used. Fixes a bug where TinyMCE may insert empty paragraph tags.
  • When saving, add back the two line breaks between HTML comments if they are Gutenberg block markers.

#2 @azaozz
8 years ago

  • Keywords has-patch needs-testing added

#3 @danielbachhuber
8 years ago

I've confirmed 44308.patch works as expected.

I've also confirmed the post content is saved to the database as expected:

$ wp post get 1 --field=content
<!-- wp:heading -->
<h2>This is a heading block</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>This is my paragraph text.</p>
<!-- /wp:paragraph -->

Does it make sense to land this in 4.9.7 or 4.9.8?

#4 @azaozz
8 years ago

  • Keywords needs-testing removed
  • Milestone 5.04.9.7

Does it make sense to land this in 4.9.7

Think so. This is an edge case bugfix for HTML comments when wpautop is disabled in the editor.

#5 @azaozz
8 years ago

  • Owner set to azaozz
  • Resolutionfixed
  • Status newclosed

In 43336:

TinyMCE: prevent creation of paragraphs from multiple HTML comments when wpautop is disabled.

Fixes #44308.

Note: See TracTickets for help on using tickets.