Opened 14 years ago

Last modified 14 years ago

#7638 confirmed Bug

Unable to apply style to the <strong> element

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description

While checking the new stylesheet parser plugin introduced with #901 I've noted two issues:

1)

strong.green {
	color: #739E39;
}

is not listed as "Object Style" after clicking on the <strong> element.

2) Using the default sample text:

<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>

click in the middle of strong element:

<strong>sa^mple text</strong>

and in the "Styles" dropdown list, select "strong.green". Note that nothing happens (an empty <strong class="green"></strong> is inserted into the document, but that's not an expected result here).



Note: the described problem has nothing to do with the new plugin. It looks like it always worked this way, to confirm it in older versions, I've tried the following:

	{
		name : 'Strong blue',
		element : 'strong',
		attributes :
		{
			'style' : 'color:blue',
		}
	},
	{
		name : 'Strong green',
		element : 'strong',
		attributes :
		{
			'class' : 'green',
		}
	},

Change History (3)

comment:1 Changed 14 years ago by Jakub Ś

I have pasted class green to contents.css and two rules you have mentioned to \ckeditor\_source\plugins\styles\styles\default.js.

Sytles were visible in drop-down list and when I clicked inside 'sample' and chose stron.green nothing happened - no empty strong was inserted which seems ok to me.

Have I missed something?

comment:2 Changed 14 years ago by Frederico Caldeira Knabben

Status: newpending

comment:3 Changed 14 years ago by Jakub Ś

Status: pendingconfirmed

I couldn't see it because I was switching between source and wysiwyg mode and CKEditor removes empty nodes in this case. My bad:)

You can see that empty strong is inserted when viewing code in Firebug. But you don't have to go through all that trouble and creating new inline style elements. You can use "Small" or "Cited work" and effect will be the same - an empty small or cite tag will be inserted in HTML code.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy