Opened 11 years ago
Last modified 11 years ago
#12774 confirmed Bug
Image is inserted with styles even when disallowed by ACF
| Reported by: | bberg | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 4.4.6 |
| Keywords: | Cc: | Artur Delura, Piotrek Koszuliński |
Description
This is an extension of ticket #12132 https://dev.ckeditor.com/ticket/12132
The image dialog still has some ACF issues.
Expected behaviour:
If you disallow image styles, but still allow their related element attributes, the image dialog should force the usage of the attributes.
Eg: this code
<img style="width:30px; height:40px; float:left;">
should become
<img width="30" height="40" align="left">
What actually happens:
The image dialog ignores ACF and keeps the styles at first. The ACF rules are only applied after you switch to source code view.
How to reproduce:
- set this configuration
// Allow all elements/attributes/styles/classes by default
config.allowedContent = {
$1: {
elements: CKEDITOR.dtd,
attributes: true,
styles: true,
classes: true
}
};
// Then disallow some styles
config.disallowedContent = 'img{width,height,float}';
// Or all of them
//config.disallowedContent = 'img{*}';
- insert an image with width/height/align set.
- inspect the image element - it contains the style attribute.
- switch to source code view - the style attribute is gone.
Change History (1)
comment:1 Changed 11 years ago by
| Keywords: | image acf disallowedContent removed |
|---|---|
| Status: | new → confirmed |

Please see ticket #5547 starting from comment:31. We have pull request (https://github.com/ckeditor/ckeditor-dev/pull/157) for it and are aware of the issue.
I'm confirming this ticket since we don't have any opened for that issue. Once https://github.com/ckeditor/ckeditor-dev/pull/157 is reviewed and accepted we could close it.