You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #64970, the figcaption element was moved into the figure element in the editor. However, the HTML in the frontend and editor do not match completely.
<figureclass="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><divclass="wp-block-embed__wrapper"><iframetitle="Matt Mullenweg: State of the Word 2023" width="500" height="281" src="https://www.youtube.com/embed/c7M4mBVgP3Y?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe></div><figcaptionclass="wp-element-caption">Caption</figcaption></figure>
As you can see, in the editor, the block wrapper element is a div element, not a figure element.
This isn't an issue in most cases, but it can cause a visual difference when a block next to an Embed block has zero margins applied. This is because the figure element has a bottom margin applied to it.
Editor:
Frontend:
What is your proposed solution?
We should be able to make it match the front-end HTML by applying a figure element instead of the block wrapper div in the editor, and removing the existing figure element.
As a preliminary to this, it might make sense to rewrite the EmbedPreview component from a class component to a function component.
The text was updated successfully, but these errors were encountered:
Discovered while reviewing #64970
What problem does this address?
In #64970, the
figcaption
element was moved into thefigure
element in the editor. However, the HTML in the frontend and editor do not match completely.Editor:
Frontend
As you can see, in the editor, the block wrapper element is a
div
element, not afigure
element.This isn't an issue in most cases, but it can cause a visual difference when a block next to an Embed block has zero margins applied. This is because the figure element has a bottom margin applied to it.
Editor:
Frontend:
What is your proposed solution?
We should be able to make it match the front-end HTML by applying a figure element instead of the block wrapper div in the editor, and removing the existing figure element.
As a preliminary to this, it might make sense to rewrite the EmbedPreview component from a class component to a function component.
The text was updated successfully, but these errors were encountered: