Opened 14 years ago

Closed 14 years ago

#5751 closed Bug (invalid)

Paste As Plain Text does not behave consistently

Reported by: Gaurang Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 3.2.1
Keywords: Cc: gaurang.d.patel@…

Description

config.forcePasteAsPlainText is set to true and enterMode is CKEDITOR.ENTER_P

Following are 2 cases considered to generate this problem.

Case 1:

hello world
<p>some paragraph</p>

When i copy it from browser and paste it into the CKEditor area it correctly convert that to

<p>
	hello world</p>
<p>
	some paragraph</p>

Case 2:

<p>some paragraph</p>
hello world

When i copy it from browser and paste it into the CKEditor area it will get converted to

<p>
	some paragraph<br />
	hello world</p>

it add line break instead of adding paragraph. which is not as expected.

in both of the cases it should generate paragraphs for linebreaks.

Steps to Regenerate:

  1. Copy case 1 text from testData.html file attached and paste as plain text to CKEditor content area. It will generate out put as expected.
  1. Copy case 2 text from testData.html file and paste as plain text to CKEditor content area. It will generate a line break (br) instead of paragraph.

Attachments (1)

testData.html (150 bytes) - added by Gaurang 14 years ago.
Test Data File

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by Gaurang

Attachment: testData.html added

Test Data File

comment:1 Changed 14 years ago by Gaurang

Cc: gaurang.d.patel@… added

comment:2 Changed 14 years ago by Garry Yao

Keywords: Pending added; forcePasteAsPlainText enterMode removed

I have exactly the same result as expected with Ctrl-V or 'Paste as plain text' button, can you provide more details?

comment:3 in reply to:  2 Changed 14 years ago by Gaurang

Replying to garry.yao:

I have exactly the same result as expected with Ctrl-V or 'Paste as plain text' button, can you provide more details?

The difference is not when you choose Ctrl-V or 'Paste as plain text' button. the difference is while you choose two different test case.

I already attached testData.html which has 2 Html case that can be copied. the detail is already there in bug description.

comment:4 Changed 14 years ago by Frederico Caldeira Knabben

Keywords: Pending removed

comment:5 Changed 14 years ago by Garry Yao

Resolution: invalid
Status: newclosed

By pasting into a textarea we're able to see that browser has produced one more line break in the second case, so you see that opening and closing paragraph are different, we're consistently following the this behavior by having these rules:

  1. <br /> per line-breaks;
  2. <p> for two consequent line-breaks;
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