Styles not applying because CKEditor adds extra wrappers around headings #226
Unanswered
aloneinthecityy
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I’m using the plugin and I’ve noticed a strange behavior in the editor. Sometimes, when I set a text as h2 in the editor, the content that arrives on the front-end is not just the h2. It comes wrapped inside other elements, for example:
<span><span><h2>My title</h2></span></span>This ends up breaking the styles, because in my CSS I defined something like:
But since CKEditor adds span or even div around the tags, the style doesn’t apply as expected. To fix it, I have to delete the content, click “remove formatting,” and sometimes repeat this process several times until it’s cleaned up.
This doesn’t happen only with h2—I’ve seen the same behavior with other headings, and sometimes instead of span, it wraps the tag in a div.
I configured the plugin to use the default HTML editor.
Has anyone else experienced this? Is this expected CKEditor behavior (like normalization/formatting cleanup), or could it be some plugin/CKEditor configuration that I didn’t set up correctly?
Beta Was this translation helpful? Give feedback.
All reactions