Welcome to Geeklog Wednesday, December 13 2017 @ 06:06 am EST


Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 47
Location:Mexico City
I insert html content contain the <i> elements. I do this with the CKEditor. Everything works when I add "&nbsp;" and the content shows up on the webpage. But when i want to edit the previously inserted content, the <i> elements are missing.

For example:

PHP Formatted Code
<i class="fa fa-map-marker fa-2x"> </i>


I tried add this lines to the config.js (/public_html/editors/ckeditor/ckeditor.js) but not works

PHP Formatted Code
CKEDITOR.dtd.$removeEmpty['i'] = false;


PHP Formatted Code
config.protectedSource.push(/<i[^>]*><\/i>/g);


PHP Formatted Code
CKEDITOR.dtd.$removeEmpty['b'] = false;

D Web Studio - www.d-webstudio.net

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1244

Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 47
Location:Mexico City
I solved it. It is necessary to add the following lines to the file (~/editors/ckeditor/config.js) between ... CKEDITOR.editorConfig = function( config ) { ... }
PHP Formatted Code

config.protectedSource.push(/<i[^>]*><\/i>/g);  // <i></i>
config.protectedSource.push(/<span[^>]*><\/span>/g);  //<span></span>
 


And clean the browser cache (Important).
D Web Studio - www.d-webstudio.net

All times are EST. The time is now 06:06 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content