[wp-trac] [WordPress Trac] #52567: Shortcodes in separate <p> tags appear on same line in browser

WordPress Trac noreply at wordpress.org
Thu May 25 06:18:59 UTC 2023


#52567: Shortcodes in separate <p> tags appear on same line in browser
----------------------------+------------------------------
 Reporter:  pawanahluwalia  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Shortcodes      |     Version:  5.6.1
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:
----------------------------+------------------------------

Comment (by juzar):

 The issue of <p> tag in the shortcode seems to come from the fact that
 WordPress, add the p tag to every content blocks and then strips the <p>
 tag from the shortcode blocks, which is why it is causing this issue, this
 depends on which kind of feature request

 If you have the shortcode in Gutenberg like this.
 [[Image(https://drive.google.com/file/d/13G2JnuG88fsVNz2m5gfIrL0vMZ_4fDy0/view?usp=sharing)]]

 Then you would expect the first shortcode to not have the <p> tag
 associated with it and all others to have, but when you try to run that,
 you can find the shortcode except the heading tag one are stripped their
 <p> tag.

 A possible solution might be to respect the p tag given in the shortcode
 block and when using the shortcode directly in the block and respect every
 paragraph block and the paragraph column in the classical editor also.

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


More information about the wp-trac mailing list