How to configure ckeditor to not wrap content in <p> block?

Viewed 75877

I am using ckeditor on my website to make it easier for users to input HTML.

However, the data I get back from ckeditor is wrapped in <p></p> blocks. (Which I don't want.)

Is there some configuration setting that forces the editor to not wrap the text in anything?

7 Answers

For Django-ckeditor add this config in your settings.py file:

ENTER_P    = 1 # default
ENTER_BR   = 2
ENTER_DIV  = 3

CKEDITOR_CONFIGS = {
    'default': {
        'enterMode': ENTER_BR,
    },
}

If anyone comes here with ckeditor 5, don't look for this option. They have removed it, I've spent days tyring to figure this out.

I'm afraid you're not going to like it, but enter mode BR is the root of all evil. If we were able we'd removed it from CKEditor 4 long time ago and we're definitely not going to implement it in CKEditor 5.

Related GitHub issue

Related