[wp-trac] [WordPress Trac] #42531: Text is splitted into two paragraphs when switching editor tabs

WordPress Trac noreply at wordpress.org
Tue Nov 14 13:15:49 UTC 2017


#42531: Text is splitted into two paragraphs when switching editor tabs
-------------------------------------------+--------------------------
 Reporter:  ocean90                        |       Owner:  westonruter
     Type:  defect (bug)                   |      Status:  closed
 Priority:  normal                         |   Milestone:  4.9
Component:  Editor                         |     Version:  4.9
 Severity:  major                          |  Resolution:  fixed
 Keywords:  has-patch commit dev-reviewed  |     Focuses:  javascript
-------------------------------------------+--------------------------

Comment (by aduth):

 Replying to [comment:16 dd32]:
 > It looks like the code in [attachment:42531.2.diff] is really only an
 optimisation, to skip processing text when not needed (as TinyMCE will
 wrap it in a paragraph tag anyway).
 > Removing that shouldn't cause any issues from what I can see, +1 from
 me.

 Noting that there is a change in behavior after 42531.2.diff

 Before:

 {{{
 switchEditors.wpautop( 'Foo' );
 // "Foo"
 }}}

 After:

 {{{
 switchEditors.wpautop( 'Foo' );
 // "<p>Foo</p>\n"
 }}}

 However, the "After" case now more closely mimics the PHP behavior (which
 has the same result). Still worth noting that there is a difference with
 potential impact.

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


More information about the wp-trac mailing list