My CKEditor is adding a lot of unnecessary tags when applying a style to a selected paragraph
I initiate CKeditor with the following html:
<p>
Hi, this a text!</p>
When I select the paragraph and apply a style using the toolbar, CKEditor formats my html to the following:
<p>
<span style="display: none;"> </span></p>
<p>
<span id="cke_bm_173S" style="display: none;"> </span>Hi, this a text!<span id="cke_bm_173E" style="display: none;"> </span></p>
<p>
<span style="display: none;"> </span></p>
Is there any way preventing CKEditor from adding the paragraphs with the non breaking space?
Things I've already tried are adding config.fillEmptyBlocks = false; and config.IgnoreEmptyParagraphValue = true; to my config file
Update
Turns out this problem was caused by the style itself which was a custom defined style. This piece of code was the problem: {name : 'Heading1', element : 'p class= "subheadingsecondlevel"}, once I changed it to: {name : 'Heading1', element : 'p', attributes : {class : 'subheadingsecondlevel'} }