Opened 12 years ago
Last modified 12 years ago
#10328 closed Bug
Inconsistency in paste as plain text — at Version 6
Reported by: | Perttu Myry | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | 4.0 Beta |
Keywords: | Webkit | Cc: |
Description (last modified by )
Pasting seems to work bit differently when using ctrl + v and forcePasteAsPlainText option in comparison to using paste as plain text plugin when enter mode is set to div. Via paste as plain text plugin I got correct looking HTML with divs and br elements, but when pasting via ctrl + v I got just br elements as line breaks.
Here is the plain text content that I copy-pasted.
#1 first #2 second #3 third
And here's how the source looked after pasting using ctrl + v.
<div> <br /> #1 first<br /> #2 second<br /> #3 third<br /> </div>
I also checked out the event in editor.on('paste') handler and event.data.dataValue looked like this when pasting using ctrl + v.
<br>#1 first<br>#2 second<br>#3 third<br>
Whereas the event.data.dataValue looked like this when using paste as plain text plugin.
<div>#1 first</div><div>#2 second<br>#3 third</div>
Is this a bug or do these two different "paste as plain text" methods work differently by definition?
Edit:
Problem can be reproduced in divarea sample in Webkit browsers from CKEditor 4.0 beta. Editor must have following settings:
CKEDITOR.replace( 'editor1', { extraPlugins: 'divarea', enterMode : CKEDITOR.ENTER_DIV, forcePasteAsPlainText : true });
Pasting with Ctrl+V and with dialog produces different results.
Change History (8)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Status: | new → pending |
---|---|
Version: | 4.1 |
Hi,
If I understand correctly you have below configuration in editor used (force paste as plain text and enter mode set to div):
var editor = CKEDITOR.replace( 'editor1', { enterMode : CKEDITOR.ENTER_DIV, forcePasteAsPlainText : true } );
Now you clear editor contents (New Page command) and then paste NOTEPAD text with CTRL+V or with paste as plain text dialog and you see differences.
I have checked this and final result in editor was always the same. After pasting and switching to source I was able only to see
<div> <div>#1 first</div> <div>#2 second<br /> #3 third</div> </div>
@c2456 what have I missed and what are exact steps to reproduce this - to see differences in editor?
comment:3 Changed 12 years ago by
With default setup I could also reproduce proper results so I started to browse through what plugins we have in our setup. It turned out that ctrl + v pasted data is correct when using iframe editing area, but when using div editing area plugin I was able to reproduce this issue.
comment:4 Changed 12 years ago by
@c2456 could you tell me in which browser are you getting this issue? Could you also provide your build-config.js?
- I have tried with editor settings mentioned in comment two. This time I have changed them to
CKEDITOR.replace( 'editor1', { extraPlugins: 'divarea', enterMode : CKEDITOR.ENTER_DIV, forcePasteAsPlainText : true });
- I have used file attached for copying text
- I have pasted with Ctrl+v and with dialog in latest trunk version but result was always the same after switching to source mode.
Perhaps some other plugin is causing this or I simply don't understand steps that you perform.
Changed 12 years ago by
Changed 12 years ago by
Attachment: | build-config.js added |
---|
comment:5 Changed 12 years ago by
Sorry for the incomplete details, the steps you did to reproduce are correct. I uploaded the build-config.js we are using and did furthermore testing. I'm using Ubuntu 12.04 LTS and this issue happened when using Chrome version 26 (26.0.1410.63). Pasted data looked to be correct when using Firefox version 20.
I'm not sure whether doctype has any effect, but we are currently using strict XHTML 1.0 doctype in our system.
I will test this paste issue also using my Windows 7 laptop and report the results here soon.
Thanks for your efforts so far.
comment:6 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Keywords: | Webkit added |
Status: | pending → confirmed |
Version: | → 4.0 Beta |
Problem can be reproduced in divarea sample in Webkit browsers from CKEditor 4.0 beta. Editor must have following settings:
CKEDITOR.replace( 'editor1', { extraPlugins: 'divarea', enterMode : CKEDITOR.ENTER_DIV, forcePasteAsPlainText : true });
Pasting with Ctrl+V and with dialog produces different results.
NOTE: continuation of #10294.