What is @ckeditor/ckeditor5-core?
@ckeditor/ckeditor5-core is a core package for CKEditor 5, a modern JavaScript rich text editor. It provides essential functionalities and utilities for building and customizing CKEditor 5 editors.
What are @ckeditor/ckeditor5-core's main functionalities?
Editor Creation
This feature allows you to create and initialize a CKEditor 5 instance. The code sample demonstrates how to create a classic editor and attach it to a DOM element.
const ClassicEditor = require('@ckeditor/ckeditor5-editor-classic/src/classiceditor');
const Editor = require('@ckeditor/ckeditor5-core/src/editor/editor');
ClassicEditor.create(document.querySelector('#editor'))
.then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Plugin Management
This feature allows you to create and manage plugins for CKEditor 5. The code sample demonstrates how to create a custom plugin and include it in the editor configuration.
const Plugin = require('@ckeditor/ckeditor5-core/src/plugin');
class MyPlugin extends Plugin {
init() {
console.log('MyPlugin was initialized');
}
}
ClassicEditor.create(document.querySelector('#editor'), {
plugins: [ MyPlugin ]
})
.then(editor => {
console.log('Editor with MyPlugin was initialized', editor);
})
.catch(error => {
console.error(error.stack);
});
Command Management
This feature allows you to create and manage commands in CKEditor 5. The code sample demonstrates how to create a custom command and execute it within the editor.
const Command = require('@ckeditor/ckeditor5-core/src/command');
class MyCommand extends Command {
execute() {
console.log('MyCommand executed');
}
}
ClassicEditor.create(document.querySelector('#editor'))
.then(editor => {
editor.commands.add('myCommand', new MyCommand(editor));
editor.execute('myCommand');
})
.catch(error => {
console.error(error.stack);
});
Other packages similar to @ckeditor/ckeditor5-core
tinymce
TinyMCE is another popular rich text editor that provides a wide range of features and plugins. It is similar to CKEditor 5 in terms of functionality but has a different API and plugin system.
quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It offers a simpler API compared to CKEditor 5 and is highly customizable through its modular architecture.
draft-js
Draft.js is a JavaScript rich text editor framework developed by Facebook. It provides a set of React components and an immutable model for managing editor state, making it different from CKEditor 5's approach.
43.1.1 (September 25, 2024)
We are happy to announce the release of CKEditor 5 v43.1.1.
During a recent internal audit, we identified a Cross-Site Scripting (XSS) vulnerability in the CKEditor 5 clipboard package (CVE-2024-45613
). This vulnerability could be triggered by a specific user action, leading to unauthorized JavaScript code execution, if the attacker managed to insert malicious content into the editor, which might happen with a very specific editor configuration.
This vulnerability affects only installations where the editor configuration meets the following criteria:
- The Block Toolbar plugin is enabled.
- One of the following plugins is also enabled:
You can read more details in the relevant security advisory and contact us if you have more questions.
Taking the occasion, we decided to introduce additional hardening to some parts of our codebase that introduce theoretical and unexploitable issues. Our security team confirmed that none of these issues were exploitable in a real scenario, however, we decided to fix them, in order to increase the overall security posture of our software.
Released packages
Check out the Versioning policy guide for more information.
<details>
<summary>Released packages (summary)</summary>
Other releases:
</details>