What is @ckeditor/ckeditor5-highlight?
@ckeditor/ckeditor5-highlight is a plugin for CKEditor 5 that allows users to highlight text with different colors. It is useful for emphasizing parts of the text, making it easier to spot important information, or for collaborative editing where different colors can represent different users' contributions.
Highlight Text
This feature allows users to highlight text within the editor. The code sample demonstrates how to initialize CKEditor with the Highlight plugin and add the highlight button to the toolbar.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Highlight ], toolbar: [ 'highlight' ] })
Custom Highlight Options
This feature allows users to define custom highlight options. The code sample shows how to configure the editor with custom highlight colors and options.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Highlight ], toolbar: [ 'highlight' ], highlight: { options: [ { model: 'yellowMarker', class: 'marker-yellow', title: 'Yellow marker', color: 'var(--ck-highlight-marker-yellow)', type: 'marker' }, { model: 'greenMarker', class: 'marker-green', title: 'Green marker', color: 'var(--ck-highlight-marker-green)', type: 'marker' } ] } })