Ckeditor 4 is removing the <img> tag if the HTML is not correct. How to stop this behaviour
<p>we are using CKEditor in our project. We recently upgraded the version from 3.X to 4.x. After the update, we are not able to see <code>&lt;img&gt;</code> tags in the old saved documents. When we click on the source, we see </p>

<p><code>&lt;p&gt;&amp;nbsp;&lt;p&gt;</code> in place of a <code>&lt;p&gt;&lt;img ......&gt;&lt;p&gt;</code>.</p>

<p>On further debugging, we found that many documents which had the <code>&lt;img&gt;</code> tag were also having a junk attribute in the <code>&lt;img&gt;</code> tag like <code>&lt;img /="/" src="/folder/11801321/112267100.neck.png" height="308" width="467"&gt;</code>.</p>

<p>By junk, I mean this part of tag <code>/="/"</code>. This was a bug introduced while we were processing the user's input. We reverted old CKEditor version to 3.X and the editor was internally taking care of the junk values. it was trimming it off. so the users never complained. </p>

<p>But now the CKEditor 4 is not handling the HTML in the same way. It is actually stripping the whole <code>&lt;img&gt;</code> tag.</p>

<p>We have two options to fix this issue.
1. Remove the junk characters in all the documents. This is huge data. Needs approval from the user to do it.
2. Change CKEditor 4 config settings to get the same behavior as the CKEditor 3.X.</p>

<p>We are in favor of point 2. I have been searching and trying couple of config settings but haven't been able to nail it. </p>

<p>Let me know if any one has faced the same issue and have resolved it.</p>