CKEditor SDK - index

Enter Key Configuration Documentation

This sample shows how to configure the Enter and Shift+Enter keys to perform actions specified in the config.enterMode and config.shiftEnterMode settings, respectively.

You can play with different settings for the Enter and Shift+Enter keys below and then add some text in the editor. See what effect these settings have by clicking the   Source toolbar button and examining the source code.

When Enter is pressed:
When Shift+Enter is pressed:

Changing the Enter Mode setting to BR or DIV is not recommended. The default CKEDITOR.ENTER_P mode is fully supported by all editor features and plugins and is also the most correct one in terms of best practices for creating web content.

If you want to change it to control paragraph spacing, you should use stylesheets instead. Edit the contents.css file and set up a suitable margin value for <p> elements, for example:

p { margin: 0; }