Skip to content

Pasting from Word/Docs/Pages adds unwanted empty lines between paragraphs #79781

Closed

Description

@gracie

Sharing feedback from WordPress.com users (via our in-product surveys) about pasting content from external editors.

What users expect: Pasting text from Word, Google Docs, Pages, etc. keeps the original paragraph spacing and formatting.

What happens: Extra blank lines / carriage returns get inserted between paragraphs (and formatting is sometimes lost), and users say they can't remove the added spacing.

Stop adding lines or carriage returns between paragraphs of my posts that I can't get rid of!

When I paste, it creates an empty line between each phrase. Stop that.

It would be nice when we copy a Word document into a new or existing post, if all the formatting would remain the same.

When pasting in text (from Google Docs, Word, Pages, etc.) keep the text changes the same (text styles, colors, etc.). Thanks!

Note: at least some of these reporters appear to have been using the classic editor, so confirming the exact editor and browser would help with reproducing the behavior.

Activity

  1. GeorgeWebDevCy commented on Jul 4, 2026

    @GeorgeWebDevCy

    I could not reproduce this in the current block-editor paste pipeline, but I ran a small input matrix to help narrow the report.

    Environment

    • WordPress 7.0
    • Gutenberg 23.5.0 (current trunk checkout)
    • Chrome on Windows

    Inputs tested

    I passed each clipboard representation through Gutenberg's pasteHandler in block mode:

    1. Plain text with a normal blank line between two paragraphs.
    2. Google Docs-style HTML: a <meta> marker followed by two styled paragraph/span elements.
    3. Word-style HTML with two MsoNormal paragraphs and <o:p> elements.
    4. Word-style HTML containing an explicit intermediate <o:p>&nbsp;</o:p> paragraph.
    5. Pages-style HTML containing an explicit intermediate <p><br></p> paragraph.

    All five cases produced exactly two core/paragraph blocks:

    <!-- wp:paragraph -->
    <p>First paragraph.</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:paragraph -->
    <p>Second paragraph.</p>
    <!-- /wp:paragraph -->

    No empty block or extra <br> survived, including in the two cases with an explicit blank paragraph. This matches the current emptyParagraphRemover / brRemover normalization path.

    The next useful diagnostic would be the exact text/html and text/plain clipboard payload from an affected paste, plus confirmation of:

    • Block Editor vs Classic Editor.
    • Browser and OS.
    • Source application and version.
    • Whether the visible gap is an actual empty block or paragraph margin from imported formatting.

    Without one of those payloads, this may be Classic Editor-specific or dependent on source markup not represented by the common Word/Docs/Pages forms above.

  2. GeorgeWebDevCy commented on Jul 4, 2026

    @GeorgeWebDevCy

    AI assistance disclosure: OpenAI Codex assisted with the paste-input test automation, analysis, and drafting of my test report. The reported test matrix was executed against the environment stated above.

  3. deepakpra commented on Jul 14, 2026

    @deepakpra
    Contributor

    I checked this further. Google Docs works because it provides semantic heading HTML like <h2>...</h2>, so Gutenberg can preserve it as a Heading block.

    Based on the current paste HTML/fixture, Apple Pages appears to paste headings as styled paragraphs, like <p><b>...</b></p> / class-based paragraph markup, not real <h1>-<h6> tags. Without a reliable signal such as a heading tag, role="heading", or aria-level, Gutenberg cannot safely distinguish an Apple Pages heading from a normal bold paragraph.

  4. youknowriad commented on Jul 22, 2026

    @youknowriad
    Contributor

    Closing as there doesn't seem to be much we could be doing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Feature] Paste[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions