2

I need help to allow CKEditor empty tags. I know that I need to add something like CKEDITOR.dtd.$removeEmpty['i'] = false in a config file, but I can't find this file in Drupal 8.0.0 installation.

I just want to know where is the right place to add this line to allow CKEditor empty tags.

3

Rather than modify the Drupal 8 core, you should do this using some Javascript like the sample below. This can be loaded from your admin theme or other module.

(function ($, Drupal) {
  Drupal.behaviors.customCKEditorConfig = {
    attach: function (context, settings) {
      if (typeof CKEDITOR !== "undefined") {
      CKEDITOR.dtd.$removeEmpty['i'] = false;
      CKEDITOR.dtd.$removeEmpty['span'] = false;
console.log(CKEDITOR.dtd);
      }
    }
  }
})(jQuery, Drupal);

For some more details see: Drupal 8 CKeditor behaves LTR in an RTL site

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.