Editor changes code

Aug 18, 2016 at 8:34 AM
This code
<div class="feature-box feature-box-style-2">
<div class="feature-box-icon">
<em class="fa fa-server"></em></div>
More text
Changes to

<div class="feature-box feature-box-style-2">
<div class="feature-box-icon"><em class="fa fa-server"></em></div>

<p>more text</p>
What can I do to stop this from happening?
Aug 24, 2016 at 1:55 PM
The problem is that ckeditor always produces valid html content a div inside a header tag is not allowed. However you can turn off the cleanup via the protectSource setting in the Editor Config tab
( /<h2[\s\S]*?>[\s\S]*?<\/h2>/gi )
at this and your html code wont be changed.
Aug 24, 2016 at 7:15 PM
Thanks but that causes it to disappear in the WYSIWYG editor, not the source. Not a huge problem but annoying.