[wp-trac] [WordPress Trac] #3833: Extra </p> inside blockquote

WordPress Trac noreply at wordpress.org
Thu Feb 2 13:08:41 UTC 2023


#3833: Extra </p> inside blockquote
-----------------------------------+---------------------------------
 Reporter:  audwan                 |       Owner:  Archibald Leaurees
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:  Future Release
Component:  Formatting             |     Version:  2.7
 Severity:  normal                 |  Resolution:
 Keywords:  wpautop needs-refresh  |     Focuses:
-----------------------------------+---------------------------------

Comment (by Mte90):

 Investigating:

 * Exists also `wpautop` in JS, https://github.com/WordPress/wordpress-
 develop/blob/d088e31c73456179502c9bd5354fc43c6267bd7a/src/js/_enqueues/wp/editor/base.js#L1164
 that uses `autop` https://github.com/WordPress/wordpress-
 develop/blob/d088e31c73456179502c9bd5354fc43c6267bd7a/src/js/_enqueues/wp/editor/base.js#L1011
 we need to check the behavior if it is consistent before to proceed

 Looking now the problem seems fixed
 {{{#!php
         // If a <blockquote> is wrapped with a <p>, move it inside the
 <blockquote>.
         $text = preg_replace( '|<p><blockquote([^>]*)>|i',
 '<blockquote$1><p>', $text );
         $text = str_replace( '</blockquote></p>', '</p></blockquote>',
 $text );
 }}}

 Infact there is already a unit test for those cases
 https://github.com/WordPress/wordpress-
 develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/tests/phpunit/tests/formatting/wpAutop.php#L381

 I think that can be closed.

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


More information about the wp-trac mailing list