Opened 12 years ago

Last modified 7 years ago

#8686 confirmed Bug

Bold, Italic, Underline plugins not detecting formatting using style element

Reported by: gnjoseph@… Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version: 3.0
Keywords: Cc: blkishor@…, prodibaugh@…

Description

I have a document which is using style elements for bold, italics and underlines. eg:<span style="font-weight:bold">bold</span><span style="text-decoration:underline">underline</span>. I am not able to undo the styles using 'bold' and 'Italic' plugins. The issue is also with other plugins like 'underline' and 'strike through'

Change History (8)

comment:1 Changed 12 years ago by Jakub Ś

Keywords: plugin removed
Status: newconfirmed
Version: 3.6.23.0

It seems that it has been working that way from CKEditor 3.0.

comment:2 Changed 12 years ago by Jakub Ś

This issue is related to #8369

Last edited 12 years ago by Jakub Ś (previous) (diff)

comment:3 Changed 12 years ago by Jakub Ś

I have a document which is using style elements for bold, italics and underlines.

@gnjoseph in your case the below workaround might help. Please have a look at http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.coreStyles_bold as well as other coreStyles_ properties and apply for them something like I have applied below.

config.coreStyles_bold =
    {
        element : 'span',
        attributes : { 'style' : 'font-weight:bold' },
		overrides : ['strong','b']
    };

That way strong and b tags will be recognized and new tags will be inserted as spans with style.

comment:5 Changed 12 years ago by gnjoseph@…

On changing bold to normal style CKEditor removes the span element altogether removing other style attributes. Eg: <p><span style="font-family:Batang; font-weight:bold">Bold</span></p> becomes <p>Bold</p>

comment:6 Changed 12 years ago by Jakub Ś

@gnjoseph good point. My last command should sound -
Despite the above workaround there is still an issue with CKEditor as by default it should not only insert strong elements but also recognize those special styled spans with fontweight:bold or text-decoration:underline etc. When removing bold/italic/etc. other styles from span should not be removed E.g. here <span style="font-family:Batang; font-weight:bold">Bold</span> font-family should stay after unbolding the text.

Version 0, edited 12 years ago by Jakub Ś (next)

comment:7 Changed 12 years ago by Jakub Ś

Component: GeneralCore : Styles

comment:8 Changed 11 years ago by Jakub Ś

Issue can still be reproduced in CKE 4.x

Actually only original issue can be reproduced - bold style set to strong replaces whole font-wight:bold span even if span contains more than one style. If you set editor to use span as bold, it will unbold e.g. <span style="font-family:Batang; font-weight:bold">Bold</span> and leave other styles untouched.

It seems that this works based on matching context/styles now. This is very similar to how dropdowns work but unlike #9964 it may be easier to fix this behaviour as there is limited number of styles to add.

Last edited 7 years ago by Jakub Ś (previous) (diff)

comment:9 Changed 11 years ago by Jakub Ś

Test created under branch t\8686 under commit: 973f1a2

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