This is my config in settings.py
:
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'Custom',
'colorButton_colors': '000000,0000FF,FFFF00,FF0000,FF00FF,00FFFF,008000,FFFFFF',
'colorButton_enableAutomatic': False,
'colorButton_enableMore': False,
'extraPlugins': 'sharedspace',
'toolbar_Custom': [
['Italic', 'Underline'],
{'name': 'colors', 'items': ['TextColor', 'BGColor']},
],
'sharedSpaces': {
'top': 'top',
'bottom': 'bottom',
},
'removePlugins': ['elementspath', 'resize', 'magicline'],
'enterMode': 2,
'height': 150,
'width': 300,
},
}
If I have an editor with the following contents: This is a sample text.
, and I press ENTER right before the 's' in 'sample', it becomes this: This is a <br><br><div>sample text</div>
, when—I think—it should be this: This is a <br>sample text.
. Not only I'm getting an extra <br>
, but also that weird <div>
.
Seen in the inspector:
The documentation says nothing about this double <br>
or the weird <div>
, or at least I can't find anything.
I tried changing enterMode
to 1
, but this is what happens:
I almost always pre-populate the editor with text from the database, but I don't think it has anything to do with this.
If I select 'Break the line with a <br>
' in the sample in the documentation and inspect the element, I see this problem doesn't occur; however, I can't find what's causing it in my case.
I'm really stuck here.
question from:
https://stackoverflow.com/questions/65921449/ckeditor-why-am-i-getting-two-br-with-one-enter-press-with-entermode-2-and-t