Opened 13 years ago
Last modified 8 years ago
#8686 confirmed Bug
Bold, Italic, Underline plugins not detecting formatting using style element
Reported by: | 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 13 years ago by
Keywords: | plugin removed |
---|---|
Status: | new → confirmed |
Version: | 3.6.2 → 3.0 |
comment:3 Changed 13 years ago by
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 13 years ago by
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 13 years ago by
@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.
comment:7 Changed 12 years ago by
Component: | General → Core : Styles |
---|
comment:8 Changed 12 years ago by
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.
It seems that it has been working that way from CKEditor 3.0.