Opened 4 years ago
Last modified 18 months ago
#52567 new defect (bug)
Shortcodes in separate <p> tags appear on same line in browser
Reported by: | pawanahluwalia | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.6.1 |
Component: | Shortcodes | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Please see the posts at the link below:
This problem:
- ONLY occurs with <p> tags
- Only when no other item is between the tags except the shortcode.
- It does NOT occur when using other tags, such as headings, lists, etc.
- It does NOT occur if there is something before or after the shortcode in the same tag that is non-whitespace.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
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.
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.