Skip to content

Paste from HTML email #4171

Open

Description

@ellatrix

Issue Overview

Pasting content from HTML emails has already greatly improved, but sometimes it still results in a table block if the email is structured with tables and part of it was copied. I wonder if we can't do a better job here, maybe detect if the table only has one cell, or check if the cell has any block level HTML content.

Activity

  1. added
    [Priority] Low
    on Dec 26, 2017
  2. mtias commented on Oct 7, 2018

    @mtias
    Member

    @iseulde do you think there's anything we can do better here in the short term or should we close?

  3. designsimply commented on Jan 8, 2019

    @designsimply
    Member

    Tested and confirmed that copying and pasting content from an HTML email structured with tables results in a table block.

    Example original email: https://pastebin.com/tanQhPjZ

    Example email:

    Example result of selecting everything in the email and pasting into Gutenberg:

    screen shot 2019-01-08 at 4 14 22 pm

  4. added
    [Type] Enhancement
    on Jan 8, 2019
  5. self-assigned this
    on Jan 9, 2019
  6. added
    Needs Testing
    on Apr 30, 2025
  7. karmatosed commented on Apr 30, 2025

    @karmatosed
    Member

    Adding a needs testing label to be sure this is still valid.

  8. SirLouen commented on Jul 6, 2025

    @SirLouen
    Member

    Reproduction Report

    Description

    ✅ This report can still be reproduced

    Environment

    • WordPress: 6.9-alpha-60416
    • PHP: 8.2.29
    • Server: Apache/2.4.62 (Debian)
    • Database: mysqli (Server: 11.8.2-MariaDB-ubu2404 / Client: mysqlnd 8.2.29)
    • Browser: Chrome 138.0.0.0
    • OS: Windows 10/11
    • Theme: Twenty Twenty-Five 1.2
    • MU Plugins: None activated
    • Plugins:
      • Gutenberg 21.1.0
      • Test Reports 1.2.0

    Instructions

    • Find an email using tables for formatting
    • 🐞 When copying and pasting the table content, it gets to Gutenberg in a series of unformatted tables.
      Note that the original code used by the email, tested by me, is practically the same as the one proposed here.

    Actual Results

    • ✅ Table blocks still appearing.

    Additional Notes

    • Pasting the code reported here results in a preformatted block though, so it’s not happening the same behaviour any more (check below)
    • ATM, I cannot really judge if this is the expected behaviour. I can't see any scenario where the email could hold the appearance a little.

    Supplemental Artifacts

    Original Email Aspect

    original email

    After Pasting

    after pasting

    Pasting code in a comment generates a preformatted block:

    preformatted result

  9. SirLouen commented on Jul 16, 2025

    @SirLouen
    Member

    @karmatosed confirmed that it's still valid, Needs Testing label can be switched.

  10. added
    Needs Dev
    and removed
    Needs Testing
    on Jul 29, 2025
  11. added
    [Status] In Progress
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Dev[Feature] Paste[Priority] Low[Status] In Progress[Type] Enhancement

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions