[wp-trac] [WordPress Trac] #45636: Html edit mode in Gutenberg editor removes wrapping <p> tags

WordPress Trac noreply at wordpress.org
Sun Nov 24 14:49:07 UTC 2019


#45636: Html edit mode in Gutenberg editor removes wrapping <p> tags
-------------------------------------------------+-------------------------
 Reporter:  skarabeq                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Editor                               |     Version:  5.0
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch reporter-feedback close  |     Focuses:
-------------------------------------------------+-------------------------

Comment (by Table28):

 Using the standard WordPress import/export plugin, I exported over 1200
 posts from one site and imported it into a new installation. The code in
 the new site edit as html in the "classic" block added
 {{{
 <br />
 }}}
 where the original version showed blank spaces between paragraphs with no
 visible code in between.

 In addition, the code in the destination db adds
 {{{
  
 }}}
 but strips out the


 {{{
 <br />
 }}}




 The below illustrates the difference


 {{{
 <!-- from the origin DB -->

 “Dyslexic” was the diagnosis.

 So we sent her to a private school, the best; De Niro sent his kid there
 too. The tuition – <em>$50,000+ a year</em>. I didn’t have $50K,
 }}}


 {{{
 <!-- Copied from the destination "classic block" edit as html -->

 “Dyslexic” was the diagnosis.<br />So we sent her to a private school, the
 best; De Niro sent his kid there too. The tuition – <em>$50,000+ a
 year</em>. I didn’t have $50K,
 }}}


 {{{
 <!-- Copied from the destination DB -->

 “Dyslexic” was the diagnosis.
 So we sent her to a private school, the best; De Niro sent his kid there
 too. The tuition – <em>$50,000+ a year</em>. I didn’t have $50K,
 }}}

 The result was that the paragraphs on the front-end of the destination
 site showed no spaces between them until I added this CSS:


 {{{
 br
 {   content: "A" !important;
     display: block !important;
     margin-bottom: 1em !important;
 }
 }}}

 This may not be the best place to get answers but I do have a couple of
 questions:

 1. While this fixed the front-end appearance, does it not also increase
 the server load with the additional CSS?

 2. Is the fact that the code differs between what is in the db vs what is
 in "edit as html" classic an issue?

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


More information about the wp-trac mailing list