Opened 4 years ago

Closed 3 years ago

#13047 closed Bug (expired)

<figure> in stylesSet does not wrap <img>

Reported by: Osvaldas Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version:
Keywords: Cc:


I define this in config:

stylesSet	: [ { name: 'Figure', element: 'figure' } ]

In the editor, when I select an image (<img>) and then select "Figure" from the styles list, I get this (view source):

<figure alt="" src="img.jpg"> </figure>

...instead of this:

<figure><img alt="" src="img.jpg"></figure>

There's something wrong with <figure> treatment in the editor, because if I change "figure" to "span" in stylesSet, the image gets nicely wrapped.

Change History (4)

comment:1 Changed 4 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.4.7

Please use Format for that. You want to use single format tag so setting styles in no the right way to go here. Please use below:

var editor = CKEDITOR.replace( 'editor1', {
	format_tags : 'p;h1;h2;h3;h4;h5;h6;pre;address;div;figure',
	format_figure : { element: 'figure' } /*, attributes: { 'class': 'custom_class_name_from_contents.css' }*/

You can style your figure element with custom class put in contents.css.

comment:2 Changed 4 years ago by Piotrek Koszuliński

Resolution: invalid
Status: closedreopened

The question is why (and if - I didn't check) it works in the format plugin but not in the styles combo. They both use the style system in a very similar way.

Last edited 4 years ago by Piotrek Koszuliński (previous) (diff)

comment:3 Changed 4 years ago by Jakub Ś

Status: reopenedpending

I have checked style in full package in every browser with enter mode set to P, Div and BR. It works fine as well.

I have used default editor and only altered the sample:

var editor = CKEDITOR.replace( 'editor1', {
	stylesSet	: [ { name: 'Figure', element: 'figure' } ]

@Reinmar if it pleases you I will leave this ticket open. @osvaldas if possible, please provide exact steps to reproduce this problem in default editor.

comment:4 Changed 3 years ago by Piotrek Koszuliński

Resolution: expired
Status: pendingclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy