Skip to content

Pasting from Microsoft Word doesn't strip its internal styling definitions #9761

@troytempleman

Description

@troytempleman

Description of the bug

Copying and pasting text from Microsoft Word into the Gutenburg editor in Google Chrome gives undesirable results. The title pastes fine but when pasting the remaining text underneath the title, the first block of text gets filled with code, seemingly font styles from Microsoft Word (see https://user-images.githubusercontent.com/15160389/45310537-1400ed80-b501-11e8-9310-5eff8681ddf3.jpg).

The text does get pasted and formatted as expected but you have to scroll down underneath the first block to see it (see https://user-images.githubusercontent.com/15160389/45310546-1fecaf80-b501-11e8-97b6-8cc875161d62.jpg). You then have to delete the first block of styles to achieve the desired result.

To Reproduce

  1. Copy title Lorem ipsum dolor... from https://github.com/WordPress/gutenberg/files/2367501/Word.docx and paste into Gutenburg editor in Google Chrome
  2. Copy remaining text from Word document and paste into Gutenburg editor, underneath above title.

Expected behavior

Pasted text should retain the same formatting as in the Word document, without any extra code and/or styles being inserted.

Screenshots

screenshot-1
screenshot-2

Desktop

  • Windows NT 10.0
  • Chrome 68
  • See whatsmybrowser.org/b/YKKNBLZ for more information

Additional context

  • WordPress 4.9.8 and Gutenburg 3.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Feature] Paste[Status] DuplicateUsed to indicate that a current issue matches an existing one and can be closed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions