paste-plaintext.md 2.7 KB


menu-title: Paste plain text category: features-pasting

order: 30

{@snippet features/build-paste-source}

Pasting plain text

The plain text pasting feature is provided through the {@link module:clipboard/clipboard~Clipboard} plugin, which is responsible for the integration with the native clipboard and intercepts all native events like copy, cut or drop and handles them on its side. The goal is to not allow the browser to touch the content in the rich text editor which would lead to unexpected results in handling the content.

Pasting plain text with a double line break will turn the break into a paragraph. A single line break will instead be turned into a soft break upon pasting.

Keyboard shortcut

The plain text pasting itself is further aided by the {@link module:clipboard/clipboard~PastePlainText} plugin. It detects the Ctrl/Cmd+Shift+V keystroke during the paste and causes the pasted plain text to inherit the styles of the content it was pasted into.

Demo

Paste plain text between the styled paragraphs below using the Ctrl/Cmd+Shift+V to test the style inheritance. Paste without modifier to retain unstyled text. You can copy this very paragraph or one from the demo for convenience.

{@snippet features/paste-plaintext}

Related features

CKEditor 5 supports a wider range of paste features, including:

  • {@link features/paste-from-word Paste from Word} – Allows you to paste content from Microsoft Word and maintain the original structure and formatting.
  • {@link features/paste-from-google-docs Paste from Google Docs} – Allows you to paste content from Google Docs maintaining the original formatting and structure.

Installation

This feature is enabled by default in all official builds. <!-- The installation instructions are for developers interested in building their own custom rich-text editor. -->

Support for other applications

You can find more information regarding compatibility with other applications in this ticket.

If you think that support for any of the applications needs improvements, please add 👍 and comments in the following issues:

Feel free to open a new feature request for other similar applications, too!