Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor, how to delete empty paragraphs before and between widgets

If you have an empty paragraph before a widget, it cannot be deleted, nor can an empty paragraph after, or between widgets be deleted, except by viewing the source.

This is evident on the CKEditor demo page here: http://ckeditor.com/demo#widgets

simply clear all the content to start, add a paragraph, add a widget, and try to remove the first paragraph.

Note that in my configuration I am not filling empty paragraphs with a non-breaking space, and I get the same behavior, so that doesn't seem to be related. enter image description here

This really does create a problem for a content management system.

like image 914
Craig Jacobs Avatar asked May 15 '15 14:05

Craig Jacobs


1 Answers

This is a known issue, but there's no patch yet. This would require some additional rules for delete and backspace, so if the current paragraph is already empty they should remove it instead of focusing widget. This code could land e.g. here: https://github.com/ckeditor/ckeditor-dev/blob/3a10930/core/selection.js#L339-L365.

like image 70
Reinmar Avatar answered Sep 30 '22 07:09

Reinmar