Ticket #5751 (closed Bug: invalid)

Opened 5 years ago

Last modified 4 years ago

Paste As Plain Text does not behave consistently

Reported by: gaurang.d.patel 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

testData.html (150 bytes) - added by gaurang.d.patel 5 years ago.
Test Data File

Change History

Changed 5 years ago by gaurang.d.patel

Test Data File

comment:1 Changed 5 years ago by gaurang.d.patel

  • Cc gaurang.d.patel@… added

comment:2 follow-up: ↓ 3 Changed 5 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 5 years ago by gaurang.d.patel

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 5 years ago by fredck

  • Keywords Pending removed

comment:5 Changed 4 years ago by garry.yao

  • Status changed from new to closed
  • Resolution set to invalid

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 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy