Opened 14 years ago
Last modified 14 years ago
#6415 confirmed Bug
Style defined in stylecombo plugin with "pre" element ignores class property in Internet Explorer when applied without selecting text
Reported by: | Nicolás Cardelino | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Styles | Version: | 3.4.1 |
Keywords: | IE | Cc: |
Description
Steps to reproduce:
- Define the following style:
CKEDITOR.config.stylesCombo_stylesSet = 'wiki_styles'; CKEDITOR.addStylesSet('wiki_styles', [ { name: 'Code', element: 'pre', attributes: { 'class': 'Code'} } ]);
- From Internet Explorer, write a paragraph and place the cursor at the begining of the paragraph.
- Select the style defined in step 1 from the styles combo (named "Code").
After following these steps, the text entered in step 2 will be inside a pre element, but the class attribute won't be defined.
CKEditor version: 3.4.1
Browser: Internet Explorer 8
OS: Ms Windows 7
I debugged the code and found that the problem is in the "toPre" function located in "_source\plugins\styles\plugin.js". According to the comment, IE normalizes innerHtml to <pre>, breaking whitespaces, and to avoid that, a new <pre> element is created. The new <pre> lacks the original class attribute (and all other attributes) defined in the style definition.
Thanks!
Change History (2)
comment:1 Changed 14 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 14 years ago by
Component: | General → Core : Styles |
---|---|
Keywords: | IE added |
Confirmed also on CKEditor 3.4.2 trunk