[wp-trac] [WordPress Trac] #48256: WP remove first <p> in <td>

WordPress Trac noreply at wordpress.org
Thu Apr 30 13:16:58 UTC 2020


#48256: WP remove first <p> in <td>
-------------------------------------+------------------------------
 Reporter:  Sebafaim                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Editor                   |     Version:  5.2.3
 Severity:  major                    |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+------------------------------
Changes (by samful):

 * keywords:  needs-patch => needs-patch 2nd-opinion


Comment:

 This ticket was never really very well explained, so I will try and
 explain my understanding of it:

 The Issue:

 Using the "TinyMCE Advanced" plugin and gutenburg causes some custom html
 to be deleted.

 Examples Given:


 {{{
 <td><span class="" ></span></p>
 }}}
 removes the <p> element

 {{{
 <div>
     <img src="https://source.unsplash.com/random/800x600" alt=""
 width="800" height="600" />
     <p>Here is some paragraph</p>
 </div>
 }}}
 Adds some <p> elements and then the opening <p> gets deleted

 My Observation:

 I experienced no issues at all and submitted screen-shots of my example.
 Also, yes there is a line in wpautop which deletes the opening <p> ,but
 also there is a line that deletes the closing <p> right next to it:
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/formatting.php#L581

 If someone else can replicate the original issue with proof or confirm
 what I found, then please reply with screen-shots or close the ticket.


 ----


 p.s. there is also a setting in that plugin to "Keep paragraph tags in the
 Classic block and the Classic Editor"

 "Stop removing <p> and <br> tags in the Classic Editor and show them in
 the Text tab. This will make it possible to use more advanced coding in
 the Text tab without the back-end filtering affecting it much. However it
 may behave unexpectedly in rare cases, so test it thoroughly before
 enabling it permanently. Line breaks in the Text tab in the Classic Editor
 would still affect the output, in particular do not use empty lines, line
 breaks inside HTML tags or multiple <br> tags."

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48256#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list