What is @ckeditor/ckeditor5-mention?
@ckeditor/ckeditor5-mention is a plugin for CKEditor 5 that allows you to implement mention functionality in your editor. This feature is commonly used to mention users, tags, or other entities within the text, similar to how mentions work on social media platforms.
What are @ckeditor/ckeditor5-mention's main functionalities?
Basic Mention
This feature allows you to add basic mention functionality to your CKEditor instance. The example code initializes the editor with a mention feed that triggers when the '@' character is typed, suggesting names like '@Anna', '@Thomas', and '@John'.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: ['@Anna', '@Thomas', '@John'], minimumCharacters: 1 } ] } })
Custom Mention Feed
This feature allows you to use a custom function to provide the mention feed. The example code uses a promise to simulate an asynchronous feed that filters the mention suggestions based on the query.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: (query) => { return new Promise(resolve => { setTimeout(() => { resolve(['@Anna', '@Thomas', '@John'].filter(item => item.includes(query))); }, 100); }); }, minimumCharacters: 1 } ] } })
Multiple Markers
This feature allows you to use multiple markers for different types of mentions. The example code initializes the editor with two mention feeds: one for '@' mentions and another for '#' tags.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: ['@Anna', '@Thomas', '@John'], minimumCharacters: 1 }, { marker: '#', feed: ['#Tag1', '#Tag2', '#Tag3'], minimumCharacters: 1 } ] } })
Other packages similar to @ckeditor/ckeditor5-mention
quill-mention
quill-mention is a plugin for the Quill rich text editor that provides similar mention functionality. It allows you to mention users, tags, or other entities within the text. Compared to @ckeditor/ckeditor5-mention, quill-mention is designed specifically for the Quill editor and offers similar customization options for mention feeds and markers.
draft-js-mention-plugin
draft-js-mention-plugin is a plugin for the Draft.js editor that adds mention functionality. It allows you to mention users, tags, or other entities within the text. This plugin is comparable to @ckeditor/ckeditor5-mention but is tailored for use with the Draft.js framework, offering similar features such as custom mention feeds and multiple markers.
tiptap-extensions
tiptap-extensions is a collection of extensions for the Tiptap editor, including a mention extension. It allows you to implement mention functionality similar to @ckeditor/ckeditor5-mention. The mention extension in tiptap-extensions provides customizable mention feeds and markers, making it a comparable alternative for those using the Tiptap editor.
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>