Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@ckeditor/ckeditor5-engine
Advanced tools
@ckeditor/ckeditor5-engine is a core package of CKEditor 5, a modern JavaScript rich text editor. This package provides the engine that powers the editor, including the data model, editing view, and rendering process. It is highly modular and extensible, allowing developers to create custom editing experiences.
Creating a Document
This feature allows you to create a new document instance, which is the core of the editing engine. The document holds the data model and manages the editing operations.
const { Document } = require('@ckeditor/ckeditor5-engine');
const doc = new Document();
console.log(doc);
Adding a Root Element
This feature allows you to add a root element to the document. The root element is the top-level container for the document's content.
const { Document } = require('@ckeditor/ckeditor5-engine');
const doc = new Document();
const root = doc.createRoot();
console.log(root);
Inserting Text
This feature allows you to insert text into the document. The Writer class is used to perform editing operations on the document.
const { Document, Writer } = require('@ckeditor/ckeditor5-engine');
const doc = new Document();
const root = doc.createRoot();
const writer = new Writer();
writer.insertText('Hello, world!', root);
console.log(root);
Listening to Changes
This feature allows you to listen to changes in the document. The document emits events whenever its content is modified, enabling you to react to these changes.
const { Document } = require('@ckeditor/ckeditor5-engine');
const doc = new Document();
doc.on('change', (event, batch) => {
console.log('Document changed:', batch);
});
ProseMirror is a toolkit for building rich-text editors on the web. It provides a similar data model and editing capabilities as @ckeditor/ckeditor5-engine but is more low-level, offering greater flexibility at the cost of requiring more setup and configuration.
Slate is another framework for building rich text editors. It offers a more React-friendly API compared to @ckeditor/ckeditor5-engine and is highly customizable. However, it may require more effort to implement complex features.
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It provides a simpler API compared to @ckeditor/ckeditor5-engine and is easier to get started with, but it may not offer the same level of customization and control.
The editing engine of CKEditor 5 project. More information about the project can be found at the following url: https://github.com/ckeditor/ckeditor5.
Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the LICENSE.md
file.
FAQs
The editing engine of CKEditor 5 – the best browser-based rich text editor.
The npm package @ckeditor/ckeditor5-engine receives a total of 747,119 weekly downloads. As such, @ckeditor/ckeditor5-engine popularity was classified as popular.
We found that @ckeditor/ckeditor5-engine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.