Contribute to this guide

Paste Markdown

The paste Markdown feature lets users paste Markdown-formatted content straight into the editor. It will be then converted into rich text on the fly.

This feature is still in the experimental phase. See the known issues section to learn more.

# Demo

Paste some Markdown-formatted content into the demo editor below and see it turn into rich text on the fly. You can copy this document for convenience.

Output:

This demo presents a limited set of features. Visit the feature-rich editor example to see more in action.

# Installation

⚠️ New import paths

Starting with version 42.0.0, we changed the format of import paths. This guide uses the new, shorter format. Refer to the Packages in the legacy setup guide if you use an older version of CKEditor 5.

After installing the editor, add the feature to your plugin list and toolbar configuration:

import { ClassicEditor, Bold, Italic, Essentials, PasteFromMarkdownExperimental } from 'ckeditor5';
// More imports.
// ...

ClassicEditor
    .create( document.querySelector( '#snippet-markdown' ), {
        plugins: [
            PasteFromMarkdownExperimental,
            Essentials,
            Bold,
            Italic,
            // More plugins.
            // ...
        ],
        // More of editor's configuration.
        // ...
    } )
    .then( /* ... */ )
    .catch( /* ... */ );

# Known issues

While the paste Markdown feature is already stable enough to use, it still needs some more testing. We are now focused on testing it in connection with other tools and plugins. If you have any observations, suggestions, or feedback you want to share, feel free to put them in this GitHub issue.

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

  • Paste from Office – Paste content from Microsoft Word and keep the original structure and formatting.
  • Paste from Google Docs – Paste content from Google Docs, maintaining the original formatting and structure.
  • Paste plain text – Paste text without formatting that will inherit the style of the content it was pasted into.
  • Autoformatting – Format your content on the go with Markdown-like shortcodes.

# Contribute

The source code of the feature is available on GitHub at https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-markdown-gfm