My CKEditor adds a lot of unnecessary tags when applying style to a selected paragraph
I initiate CKeditor with the following html:
<p> Hi, this a text!</p>
When I select a paragraph and apply the 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 a way to prevent CKEditor from adding paragraphs with unused space?
Things I've already tried add config.fillEmptyBlocks = false; and config.IgnoreEmptyParagraphValue = true; to my configuration file
Update It turns out this problem was caused by the style itself, which was a user defined style. This piece of code was the problem: {name : 'Heading1', element : 'p class= "subheadingsecondlevel"} , as soon as I changed it to: {name : 'Heading1', element : 'p', attributes : {class : 'subheadingsecondlevel'} }
source share