Skip to content

Commit 7db42d3

Browse files
committed
Added nbsp; example
1 parent 9745cad commit 7db42d3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/content_management/rich_text/extend_online_editor.md

+16
Original file line numberDiff line numberDiff line change
@@ -464,3 +464,19 @@ 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. The following example adds two ways to add a non-breaking space character:
469+
```js
470+
function SpecialCharactersNbsp( editor ) {
471+
# add non-breaking space to the SpecialCharacters plugin
472+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [
473+
{ title: 'Non-Breaking Space', character: '\u00a0' }
474+
] );
475+
# add a keyboard shortcut
476+
editor.keystrokes.set( 'Ctrl+space', ( key, stop ) => {
477+
editor.execute( 'input', { text: '\u00a0' } );
478+
stop();
479+
} );
480+
}
481+
ibexa.addConfig('richText.CKEditor.extraPlugins', [ SpecialCharacters, SpecialCharactersEssentials, SpecialCharactersNbsp ], true);
482+
```

0 commit comments

Comments
 (0)