Opened 14 years ago

Closed 13 years ago

#5536 closed Bug (fixed)

Problems with pasting (executing insertHtml) and formatted text

Reported by: Wiktor Walc Owned by: Tobiasz Cudnik
Priority: Normal Milestone: CKEditor 3.5
Component: General Version: 3.2.1
Keywords: Firefox Cc:

Description

This is actually a duplicate of #5170, but since that ticket was already reviewed and committed, here's another one (I guess [5273] should be reverted as the issue was misunderstood).

Note that this bug occurs when pasting any content, this is not an issue that exists only when pasting special character.

Updated description below:

When inserting content with insertHtml() inside of formatted text, editor breaks formatting and inserts content without formatting. Confirmed in FF 3.5. Works fine in IE8 and Safari 4.

Steps to reproduce

  • open _samples/api.html example
  • start with
    <p>
    	<span style="color: rgb(255, 0, 0);">Sample ^text</span></p>
    
  • clear the textarea below CKEditor and type there "foo"
  • press "Insert HTML"
  • Result:
    <p>
    	<span style="color: rgb(255, 0, 0);">Sample </span>foo<span style="color: rgb(255, 0, 0);">text</span></p>
    

This can be reproduced in many different ways in CKEditor, everywhere where insertHtml() is used.

Targetting to 3.3 as it might be a bit irritating.

Attachments (1)

5536.patch (1.3 KB) - added by Tobiasz Cudnik 14 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 14 years ago by Garry Yao

Owner: set to Garry Yao
Status: newassigned

Ok, let's try to provide a managed the 'paste' command with our own logics.

comment:2 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.3CKEditor 3.4

comment:3 Changed 14 years ago by Garry Yao

Owner: Garry Yao deleted
Status: assignednew

We'll be working on this at #5309.

comment:4 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.4CKEditor 3.5

comment:5 Changed 14 years ago by Tobiasz Cudnik

Owner: set to Tobiasz Cudnik
Status: confirmedassigned

comment:6 Changed 14 years ago by Tobiasz Cudnik

Keywords: Firefox added

Changed 14 years ago by Tobiasz Cudnik

Attachment: 5536.patch added

comment:7 Changed 14 years ago by Tobiasz Cudnik

Status: assignedreview

This is temporally fix before #5309 will be finished.

comment:8 Changed 13 years ago by Garry Yao

Status: reviewreview_failed

A temporary fix would not be a catch-all that replace entirely the original, but instead targeting only this specific case.

comment:9 Changed 13 years ago by Tobiasz Cudnik

What would be a more specific case for this issue than targeting only Firefox ?

comment:10 Changed 13 years ago by Tobiasz Cudnik

This patch may also fix #2204 for Opera.

comment:11 Changed 13 years ago by Garry Yao

Browsers (especially Firefox) deliver context-based fixes on 'insertHtml', examples like pasting list and tables. The problem here is with text node only, the patch fixes this specific case here while it could potentially breaks even more, in case an emergent fix is really required, it should be well surged.

comment:12 Changed 13 years ago by Garry Yao

Milestone: CKEditor 3.4.2CKEditor 3.5

Defer this ticket to 3.5, if #5309 is not completed in 3.5, at least we could have this one as backup.

comment:13 Changed 13 years ago by Garry Yao

Resolution: fixed
Status: review_failedclosed

Now that we've reworked the editor::insertText method which should be relied on instead for inserting plain text (where styles context are inherited).

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