diff --git a/docs/content_management/rich_text/extend_online_editor.md b/docs/content_management/rich_text/extend_online_editor.md index bd0002a1dd..811007952f 100644 --- a/docs/content_management/rich_text/extend_online_editor.md +++ b/docs/content_management/rich_text/extend_online_editor.md @@ -464,3 +464,21 @@ ibexa.addConfig('richText.CKEditor.extraConfig', { specialCharacters: { order: [ ``` ![CKEditor Special characters: Arrows category on top of the character filter](ckeditor-special-characters_arrows-on-top.png) + +You can also use custom functions to modify the plugin configuration. +The following example adds two ways to add a non-breaking space character: + +```js +function SpecialCharactersNbsp( editor ) { + // add non-breaking space to the SpecialCharacters plugin + editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [ + { title: 'Non-Breaking Space', character: '\u00a0' } + ] ); + // add a keyboard shortcut + editor.keystrokes.set( 'Ctrl+space', ( key, stop ) => { + editor.execute( 'input', { text: '\u00a0' } ); + stop(); + } ); +} +ibexa.addConfig('richText.CKEditor.extraPlugins', [ SpecialCharacters, SpecialCharactersEssentials, SpecialCharactersNbsp ], true); +```