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.
Despite the above workaround there is still an issue with CKEditor as by default it should not only replace span elements with e.g. strong but if span is carrying any extra styles it should remove the bold style and insert strong tag into the remaining span e.g. this <span style="font-family:Batang; font-weight:bold">Bold</span> should be transformed into <span style="font-family:Batang;"><strong>Bold</strong></span>

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

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 latest CKE 4.1 (ACF needs to be disabled)

Actually only original issue can be reproduced (bold style set to strong that doesn't remove span with font-weight bold). 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.

Version 2, edited 11 years ago by Jakub Ś (previous) (next) (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