Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#4746 closed Bug (fixed)

insertHtml left trim text

Reported by: Garry Yao Owned by:
Priority: Normal Milestone: CKEditor 3.4.3
Component: General Version: 3.0
Keywords: Confirmed Cc: jamcunni@…

Description

Reproducing Procedures

  1. Open the 'api' sample page, load the editor with the following content and selection.
    some^text
    
  2. Load the insertion area with the following content:
     insertion 
    
  3. Click on 'Insert HTML' button.
  4. Switch to 'Source' mode.
  • Actual Result:
    <p>
    	someinsertion text</p>
    
  • Expected Result:
    <p>
    	some insertion text</p>
    

Note that the left side whitespace has been trimmed, which is wrong.

Attachments (2)

4746.patch (1.6 KB) - added by Garry Yao 14 years ago.
4746_2.patch (1.8 KB) - added by Garry Yao 14 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 14 years ago by Garry Yao

Ticket Test added at :
http://ckeditor.t/tt/4746/1.html.

comment:2 Changed 14 years ago by Garry Yao

We could have an option on the dataprocessor to control the parser behavior properly.

comment:3 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.2CKEditor 3.3

comment:4 Changed 14 years ago by Garry Yao

Milestone: CKEditor 3.3CKEditor 3.4
Version: 3.0

comment:5 Changed 14 years ago by Garry Yao

Owner: set to Garry Yao
Status: newassigned

Another TC: Inserting inside a <pre> collapses all line-breaks and tabs.

Changed 14 years ago by Garry Yao

Attachment: 4746.patch added

comment:6 Changed 14 years ago by Garry Yao

Keywords: Review? added

Introduce an idea that allows context sensitive html parsing with ease.

comment:7 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.4CKEditor 3.5

comment:8 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_failed

The element should not be noticable in the elements path.

Changed 14 years ago by Garry Yao

Attachment: 4746_2.patch added

comment:9 Changed 14 years ago by Garry Yao

Status: review_failedreview

Align patch with trunk. @Saar, this's a virtual context that only seen in the parser, it will not exist in wysiwyg at all.

comment:10 in reply to:  9 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_failed

Replying to garry.yao:

@Saar, this's a virtual context that only seen in the parser, it will not exist in wysiwyg at all.

I can move the cursor into the span, so it's visible in the elements path. The user should not know we have a temporary span there.
4746_2 is not working for me on IE for some reason, 4746 does though.
Also please note that after the patch the data variable is set twice.

comment:11 Changed 14 years ago by Garry Yao

Milestone: CKEditor 3.4.2CKEditor 3.5

Well, it seems I'm quite naive for IE as even we fixed our parser, IE's 'pasteHTML' still won't let this leading space pass, so the fix only partially work, in this case we will need to again wait for #5309, defer it to 3.5

comment:12 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.5CKeditor 3.4.3

comment:13 Changed 13 years ago by Garry Yao

Status: review_failedassigned

comment:14 Changed 13 years ago by Garry Yao

Owner: Garry Yao deleted
Status: assignednew

comment:15 Changed 13 years ago by Garry Yao

Resolution: fixed
Status: newclosed

Now that we've reworked the editor::insertText method which should be relied on for inserting plain text (where leading whitespaces are preserved).

comment:16 Changed 13 years ago by James

The initial test case is still reproducible on the nightly build and should be reopened.

comment:17 Changed 13 years ago by James

Cc: jamcunni@… added

comment:18 Changed 13 years ago by Wiktor Walc

@james - I've created a separate issue: #6876 to check it.

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