[wp-trac] [WordPress Trac] #42340: Spurious Insertion of <p>aragraph Tags

WordPress Trac noreply at wordpress.org
Thu Oct 26 23:47:51 UTC 2017


#42340: Spurious Insertion of <p>aragraph Tags
--------------------------+------------------------------
 Reporter:  oeconomist    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by oeconomist):

 When a user copies-and-pastes, the presumption should be that the source
 was marked-up as intended by whomever or whatever created it. Otherwise,
 if the source has inline elements, then the copy-and-paste may fail after
 conversion, in a way that is perfectly mysterious to users who aren't used
 to doing their own mark-up.

 I've not dived into the code (nor do I intend to do so), but I would guess
 that at some point WordPress converts two consecutive newlines into two
 break elements, and that wpautop effectively assumes that all back-to-back
 instances of two break elements arose from such a conversion.  Assuming
 both that my guess is correct and that there is a good reason for that
 first conversion, I suggest that it be replaced by a substitution such as
 “<br /><!-- convertible --><br />” and that wpautop act when it encounters
 this new substring, leaving alone two back-to-back break elements.

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


More information about the wp-trac mailing list