-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CKEditor removes internal CSS #14661
Comments
The editor will not preserve the style, and will mark it as unsafe. We would recommend adding the styles to the page's head or CSS file. There's a workaround (using FullPage plugin), that was proposed in one comment as a custom plugin. |
@Witoso Thanks for replying. I have checked this plugin FullPage but its not supporting internal CSS.
When I click on source, editor ignores style and render whatever is inside body. |
I used this workaround and it causes styles to "bleed" outside the editor. To me that solution isn't good enough to be promoting to solve the desired use. |
Sorry for not making it more explicit. The proper way is to use CSS to style the content if that's your use case. CKE5 will not accept the style tag, and we would rather not promote rendering |
@Witoso I have tried this workaround for the above html code |
Do you have GHS enabled? |
@Witoso yes it is enabled |
But does the config allows it? In the full configuration:
|
Hi @Witoso, |
Did you add this function to plugins list of the editor? |
Hi @Witoso, ` class Editor extends ClassicEditor {} function RenderStyleElements( editor ) { // Plugins to include in the build. // Editor configuration. export default { Editor, EditorWatchdog }; But, it still removes internal css, any suggestions if anything is wrong here? |
Hi @anchal04, did you find any solution for this? I have tried above but it didn't work. |
yes, Above workarounds(#13482 (comment) & #12838 (comment)) solves the issue. Thanks @Witoso @srav09 If you are using ckeditor custom build editor then try these steps:
|
Hi,
I am upgrading CKEditor from version 4 to 5.
When I paste any HTML and click on source button It ignores the internal style applied and render only plain html.
Here, class style is ignored and div is rendered without style
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: