Skip to content

Commit b6ac418

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/content_management/rich_text/extend_online_editor.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cd ..
12
---
23
description: Add custom tags, styles and data attributes to enrich the functionality of the Online Editor. Change Online Editor configuration.
34
---
@@ -464,3 +465,19 @@ ibexa.addConfig('richText.CKEditor.extraConfig', { specialCharacters: { order: [
464465
```
465466

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

0 commit comments

Comments
 (0)