WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.42k stars 4.17k forks source link

Classic block still displaying unwanted p and br tags when Edit as HTML is chosen #10837

Open bobbingwide opened 5 years ago

bobbingwide commented 5 years ago

Describe the bug Classic block still displaying unwanted p and br tags when Edit as HTML is chosen. These are somewhat misleading. These unwanted/added tags are not saved in the post_content during update.

To Reproduce Steps to reproduce the behavior:

  1. Using the Classic editor create a post something like this.
    
    Classic block still displaying unwanted p and br tags when Edit as HTML is chosen. These are somewhat misleading. These unwanted/added tags are not saved in the post_content during update.
    <!--more-->

[clear]

[bw_csv]A,B,C 1,2,3 4,5,6 [/bw_csv]

end of post


2. Edit using Gutenberg and see the contents in the Classic block
3. Choose More Options > Edit as HTML
4. Notice `p` and `br` tags being added.
5. Edit the text and perform an Update.
6. View the post.
7. The unwanted tags have magically disappeared. The content is actually how I want it.

**Expected behavior**
The Edit as HTML display should not be showing the p and br tags. It's misleading.

**Screenshots**
If applicable, add screenshots to help explain your problem.

The first screen shot is step 4.
![image](https://user-images.githubusercontent.com/2474435/47258500-dabe8480-d493-11e8-8ef0-58b7a389055b.png)

The second screen shot is step 7. You can see that I'd edited the content.
In the sidebar you can see the raw post_content that has been saved as wanted. 

![image](https://user-images.githubusercontent.com/2474435/47258521-148f8b00-d494-11e8-8bbe-41c4b0c53975.png)

**Desktop (please complete the following information):**
 - OS: [e.g. iOS] Windows 10
 - Browser [e.g. chrome, safari] Chrome
 - Version [e.g. 22] Version 69.0.3497.100 (Official Build) (64-bit)

**Additional context**
- This is a follow up to #5123. 
- The Classic block in v4.0.0 is significantly better than when I first reported the problem in v2.6 or so
tisayama commented 5 years ago

I have the same problem. Does anyone have an update?

danicholls commented 5 years ago

Is this still a problem?

bobbingwide commented 5 years ago

Yes.
36B60B4C-3E0E-4A37-A8CD-AF7882DA1C68

7D5325CC-90A9-4437-90EF-6616D1501E70

paaljoachim commented 3 years ago

Hey @bobbingwide Herb Can you retest with the newest version of WordPress and Gutenberg? Thanks!

bobbingwide commented 3 years ago

Yes. Same result if I follow my original instructions.

<p>Classic block still displaying unwanted p and br tags when Edit as HTML is chosen. These are somewhat misleading. These unwanted/added tags are not saved in the post_content during update.<br /><!--more--></p>
<p>[clear]</p>
<p>[bw_csv]A,B,C<br />1,2,3<br />4,5,6<br />[/bw_csv]</p>
<p>end of post</p>
<p>perform update.</p>