Skip to content

Commit 565bf15

Browse files
reithorjulitafalcondusza
authored andcommitted
Added "Non-Breaking Space" example (#2670)
* Added nbsp; example * fixed line comments * remove trailing whitespace * Update docs/content_management/rich_text/extend_online_editor.md Co-authored-by: julitafalcondusza <[email protected]> --------- Co-authored-by: julitafalcondusza <[email protected]>
1 parent b556ea2 commit 565bf15

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/content_management/rich_text/extend_online_editor.md

+18
Original file line numberDiff line numberDiff line change
@@ -464,3 +464,21 @@ ibexa.addConfig('richText.CKEditor.extraConfig', { specialCharacters: { order: [
464464
```
465465

466466
![CKEditor Special characters: Arrows category on top of the character filter](ckeditor-special-characters_arrows-on-top.png)
467+
468+
You can also use custom functions to modify the plugin configuration.
469+
The following example adds two ways to add a non-breaking space character:
470+
471+
```js
472+
function SpecialCharactersNbsp( editor ) {
473+
// add non-breaking space to the SpecialCharacters plugin
474+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [
475+
{ title: 'Non-Breaking Space', character: '\u00a0' }
476+
] );
477+
// add a keyboard shortcut
478+
editor.keystrokes.set( 'Ctrl+space', ( key, stop ) => {
479+
editor.execute( 'input', { text: '\u00a0' } );
480+
stop();
481+
} );
482+
}
483+
ibexa.addConfig('richText.CKEditor.extraPlugins', [ SpecialCharacters, SpecialCharactersEssentials, SpecialCharactersNbsp ], true);
484+
```

0 commit comments

Comments
 (0)