Ticket #6168 (closed Bug: fixed)

Opened 5 years ago

Last modified 2 years ago

Multiple styles lost when changing coreStyles_underling to use <span> with inline style

Reported by: steve_wood Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.5
Component: Core : Styles Version: 3.4
Keywords: IBM Cc: lynne_kues

Description (last modified by krst) (diff)

I changed the editor configuration object so that instead of inserting a <u> for underline, it inserts a <span> with an inline style :

coreStyles_underline: {
         element: "span", 
         attributes : {style: "text-decoration: underline"}
}

This works great except that when you apply this to an element that has had e.g. it's font size increased, the "underline" span replaces the font size one, effectively losing that style.

To reproduce - create an editor with the configuration modified as above, enter some text, either change the font family or font size of the text, then underline the text.

Attachments

autogrow.html (2.8 KB) - added by steve_wood 5 years ago.
6168.patch (791 bytes) - added by garry.yao 3 years ago.

Change History

Changed 5 years ago by steve_wood

comment:1 in reply to: ↑ description Changed 5 years ago by steve_wood

Attached modified version of the "autogrow" sample provided with the editor to show the problem.

comment:2 Changed 4 years ago by krst

  • Status changed from new to pending
  • Keywords IBM added; ibm removed
  • Component changed from General to Core : Styles
  • Description modified (diff)

I Confirmed this issue. Do You mean that it should work like this:

<span style="font-size: 16px; text-decoration: underline ">
This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.

System Message: WARNING/2 (<string>, line 3)

Definition list ends without a blank line; unexpected unindent.

</span>

Instead of:

<span style="font-size: 16px; ">
<span style="text-decoration: underline">
This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.

System Message: WARNING/2 (<string>, line 4)

Definition list ends without a blank line; unexpected unindent.

</span>

System Message: WARNING/2 (<string>, line 5)

Definition list ends without a blank line; unexpected unindent.

</span>

comment:3 Changed 4 years ago by steve_wood

Hi,

What i see is that when I apply the text size, the DOM contains this :

<span style="font-size: 24px;">

Text <br type="_moz">

</span>

The, when i click the U button to apply underline (where the core style is modified to use a span) the DOM becomes : -

<span style="text-decoration: underline;">

Text <br type="_moz">

</span>

What i would have hoped to see is :

<span style="font-size: 24px;">

<span style="text-decoration: underline;">

Text

</span> <br type="_moz">

</span>

So the spans are nested, whereas at present one seems to replace the other.

thanks, Steve.

Changed 3 years ago by garry.yao

comment:4 Changed 3 years ago by garry.yao

  • Status changed from pending to review
  • Owner set to garry.yao
  • Milestone set to CKEditor 3.6.5

The styles specified as inline attribute, should be resolved as the same with definition.styles.

comment:5 Changed 2 years ago by fredck

  • Status changed from review to review_passed

Please have a test for this when committing.

comment:6 Changed 2 years ago by garry.yao

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [7599].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy