image_caption unable to remove class from figure element.
When an image is given a caption through the "image_caption" feature you can add custom classes to the figure element via the "style_formats" dropdown but you cannot remove them.
I've set up a fiddle here: http://fiddle.tinymce.com/0ggaab/11
1.) Insert an image with the "Show caption" option selected. 2.) Select FIGURE > FIGCAPTION and apply the Align Left style from the dropdown. (Selecting figure does nothing even though the selector for that style is figure) 3.) If you view the source you can see the "align-left" class is added to the figure element as expected. You can also see it marked as applied in the style_format dropdown. 4.) Go to the dropdown and try to remove the class, nothing happens.
If you go into the source and remove both the image and align-left classes then hit save, you can add and remove the Align Left style via the dropdown with no issues.
Any updates on this? The workaround noted works for us, but we'd prefer our users don't have to edit the source.
Apologies for the delay. The reason why the class cannot be removed after the fact is because the figure has a contenteditable=”false” attribute. Here is a fiddle that allows style formats to override the contenteditable=”false” behaviour: http://fiddle.tinymce.com/0ggaab/12
Technically, the class should not be able to be applied to the figure from the figure caption so a ticket has been created internally for us to investigate that.
Let us know if this was helpful or not. Thanks!
Perfect, thank you! One more question if I may, where would I have found this in the documentation? I spent quite a bit of time trying to find some sort of configuration option similar to this.
@cjwahl Sorry, we currently do not have the ceFalseOverride and collapsed option documented. I have created a ticket internally for us to update the documentation. Please reach out if you have any other questions. Thank you!
4 years later this ceFalseOverride option is still undocumented (I spent 2 days before ending up here) 😒
Thank [prefered diety] for finding this issue, I have tried to figure out how to apply a format to a FIGURE created by the Insert image-plugin for a few hours now.
I figured out the contenteditable=false stopped it, but could not find a way around it, and the "wrapper and format_noneditable_selector" approach I thought was the solution did not work either.
So yes please document this!