Skip to content

Headings not pasted from Word in the browser #63824

@mrwweb

Description

@mrwweb

Description

This may be an upstream issue, but it seems worth tracking here at least to help other people know it's not just them…

When copying formatted text from the online version of Microsoft Word (i.e. what you can access free from Office.com), headings are not copy-pasted into the Block Editor. Some formatting such as bold still can be copy-pasted.

Although I do not have desktop Word, I've been told this works as expected in that version.
@Clorith was able to confirm this issue and was helpfully able to share the following context:

apparently the web versions intentionally changed their markup generation for copying text, there's discussions about this being a problem after their years of weird markup at least being the same, and it is breaking pasting into other platforms besides WordPress as well, who have previously worked to make it as painless as possible, waiting to hear if anyone has picked it up internally, or if it's a matter of "well, now you need to maintain two parsers for pasted content, have fun" kind of scenario

Step-by-step reproduction instructions

  1. Create a heading in Word from Office.com
  2. Copy the heading
  3. Paste into the Block Editor

Result: text is pasted as a paragraph rather than a heading.

Screenshots, screen recording, code snippet

Text in Word:

Three lines of text. The first is a Heading 2, the second is bolded, and the third is plain

Pasted result:

The resulting

Environment info

WordPress 6.6

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions