...">

Ckeditor removes empty tags

The problem with ckeditor when a user inserts empty tags:

(in html soucre mode)

<a href="fds" class="doIt"></a> 

When he clicks on the source and then back, the tag "A" has disappeared. I did a little research, and I found that this happens because ckeditor.js has a very complex function that checks to see if there is a value inside an element. If not there, ckeditor removes the tag.

+7
source share
3 answers

I found a solution to this particular problem that I ran into a tag

The original answer I received from the CKEditor strip <i> Label

Correct or configure (you name it) to install the following in ckeditors config.js:

 // ALLOW <i></i> config.protectedSource.push( /<i[\s\S]*?\>/g ); //allows beginning <i> tag config.protectedSource.push( /<\/i[\s\S]*?\>/g ); //allows ending </i> tag 
0
source

If this does not affect anything, try adding &nbsp; A. ckeditor checks, disinfects and cleans html in its tag. Obviously, he does not like empty anchor tags.

-one
source

Try adding this line to your config.js file:

 CKEDITOR.config.allowedContent = true; 

Hope this helps

-one
source

All Articles