Gutenberg: Classic block removing paragraph end tag on save

Created on 9 Nov 2018  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug
The end paragraph tag is missing in the post contents sent to the rest API save call from the classic block if that paragraph contains a line break and the starting p tag has an attribute.

To Reproduce
Steps to reproduce the behavior:

  1. Create new post in Gutenberg
  2. Add Classic Block and switch to Edit as HTML
  3. Add
    <p class="classy">Here
    is a paragraph</p>
  4. Publish Post
  5. See Request Payload in debugger or look at post in database. content property is:

"<p class="classy">Here鈫礽s a paragraph"

Expected behavior
end tags to remain

Screenshots
image

Desktop:

  • OS: Windows 10 64 bit
  • Browser Chrome
  • Version 70.0.3538.67

Additional context

  • Replicated on both Gutenberg plugin 4.4.0 running on WordPress 4.9.8 and WordPress 5.0 beta 3
[Block] Classic [Type] Bug

All 5 comments

Sorry, that's Gutenberg plugin version 4.2.0

Tested and confirmed by checking the post content in phpMyAdmin after entering the following HTML in "Edit as HTML" mode in a classic block:

<p class="classy">This
is my paragraph with a line break in it.</p>

screen shot 2018-11-12 at 11 49 06 am

screen shot 2018-11-12 at 12 04 57 pm

Tested with WordPress 4.9.8 and Gutenberg 4.3 using Firefox 63.0.1 on macOS 10.13.6.

@kfts I checked the database directly in my case, but could you tell me exactly how to get to the same Request Payload from your screenshot? I would like to learn that. 馃檪 It looks like the Network panel in Chrome's web developer tools to me, but I wasn't sure what to filter for or when to check that (would it be right after saving in the editor itself?).

@designsimply You're correct, it's the Network panel in Chrome's DevTools. When you click Update with it open, you'll see a rest API call to /index.php/wp-json/wp/v2/posts. Click on it, select Headers and you can expand the "Request Payload" to see what is being sent over.

Cool. Spotted it! (screenshot) Thanks for the tip. 馃榿

I was not able to reproduce the issue. I think it's probably fixed.

Was this page helpful?
0 / 5 - 0 ratings