ckeditor5-paste-plaintext
v1.3.0
Published
Paste as plaintext plugin for CKEditor5
Downloads
23
Maintainers
Readme
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
'pasteAsPlainText'
]
})
)
Credits
The toolbar icon is based on an SVG file created by Vitaly Gorbachev.