[wp-trac] [WordPress Trac] #52764: Classic editor adding empty <p></p> tags in some media embed situations
WordPress Trac
noreply at wordpress.org
Thu Mar 11 20:43:09 UTC 2021
#52764: Classic editor adding empty <p></p> tags in some media embed situations
-----------------------------+---------------------
Reporter: jonathanstegall | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.7.1
Component: Editor | Version: 5.7
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+---------------------
Comment (by jonathanstegall):
Replying to [comment:10 Otto42]:
> Replying to [comment:3 jonathanstegall]:
> > After reinstalling 5.6.2 a few times, I think I'm starting to realize
that (at least in some cases) this empty `<p></p>` was already there,
seemingly because the `<figure>` is getting put inside a paragraph and the
browser (as usual) renders it as an empty paragraph instead. But in
previous versions the empty paragraph didn't have CSS to make it visible.
In 5.7 there is maybe new CSS that makes it visually apparent when it
wasn't before.
> >
> > Am I correct on this?
>
> I've looked at half a dozen sites reporting this issue since yesterday,
and in all cases I've seen so far, yes, those empty P tags were already
present in the markup for those sites, or the markup was broken in such a
way that Chrome interpreted an empty set of P tags (such as an unclosed P
before a DIV and similar).
>
> The CSS change introduced into 5.7 will make those tags have space on
the page, but as far as I can see, there are no changes adding any new P
tags to the page. Only the style changes as Sergey noted above.
Yes, that seems right. I think my issue is that it never sank in for me
that the editor didn't treat shortcodes, which we get when we embed media
objects that have captions, as block level elements. It instead seems to
wrap the `div` or `figure` from the shortcode inside the paragraph that
follows, and the browser can't handle that and renders the empty paragraph
tags instead. And then as you say, in 5.7 that paragraph has CSS to make
it visible. Now that I'm looking for it I'm seeing it with all kinds of
shortcodes that render as block level elements.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52764#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list