Skip to content

basecondition/ckeditor5-paste-plaintext

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paste as plain text plugin for CKEditor5

This plugin adds a toggleable button to enable or disable pasting text as plain text only.

It is virtually the same as the example plugin from the clipboard tutorial, but as an npm package to be easy to integrate in CKEditor5 builds.

Installation

To add this to your CKEditor5 build, add the package to your project first:

npm install --save ckeditor5-paste-plaintext

Then add the needed import to your app.js:

import PasteAsPlainText from 'ckeditor5-paste-plaintext/src/plaintext';

Create the build with webpack, or your preferred way of building the sources - for example:

webpack --mode development

(for more details on the build process, see the framework quick start.)

And finally, add the Plugin to the editor configuration, and the button to the toolbar (among the other plugins, of course):

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ 
            // your other plugins here
            PasteAsPlainText
        ],
        toolbar: [ 
            // your other buttons here
            'pastePlainText'
        ]
    })
)

Credits

The toolbar icon is based on an SVG file created by Vitaly Gorbachev.

About

Paste as plaintext plugin for CKEditor5

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%