My CKEditor is adding a lot of unnecessary tags when applying a style to a selected paragraph
I initiate CKeditor with the following html:
You might want to consider these:
config.enterMode = CKEDITOR.ENTER_BR;
config.autoParagraph = false;
You can check out my post here for more info:
How to configure ckeditor to not wrap content in <p> block?
The following config setting will stop the editor from inserting a non-breaking space in empty paragraphs:
config.fillEmptyBlocks = false;
Was all of the additional code inserted after applying just one style?
What style did you apply, is all the extra code inserted regardless of the style you use?
What happens if you select the text and click the bold button?
Is the code you are showing being copied from the source view of the editor or from the final page that you use to display your content?
Be Well,
Joe
Or, if all fails, you can use the CSS selector pseudo-class ':empty' and give it a 'display:none'. In practice, you add this line to your CSS:
p:empty {
display:none
}
I understand it's a dirty solution but it works perfectly in most cases and has minimal inpact on design and functionality.