Table's figcaption/caption elements are not persisted when pasted into the editor #30876
Open
Description
opened on Apr 15, 2021
Description
When pasting raw HTML into the editor, the figcaption
element isn't properly persisted.
This appears to be because the figure
element isn't included when pasted in the first place, and this piece of code should have logic in place which attempts to move figcaption
s into a figure
element if one does exist.
Step-by-step reproduction instructions
- Copy following HTML into a tool like https://www.onlinehtmleditor.net/
- Copy and paste the formatted HTML into the Gutenberg editor
- The
figcaption
element is moved outside of the originalfigure
element.
The behaviour is also replicable by pasting the formatted HTML into https://wordpress.org/gutenberg/
Expected behaviour
The figcaption
should be present as a child of the figure
.
Actual behaviour
The figcaption
is without a parent and subsequently converted into a p
tag.
WordPress information
- WordPress version: "5.8.0"
- Gutenberg version: "9.4.0"
- Are all plugins except Gutenberg deactivated? "Yes"
- Are you using a default theme (e.g. Twenty Twenty-One)? "Yes"
Device information
- Device: "Desktop"
- Operating system: "Windows 10"
- Browser: "Chrome 86.0"
Activity