Opened 14 years ago
Closed 12 years ago
#6131 closed Bug (fixed)
Webkit Paste Bug
Reported by: | astralis | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | 3.0 |
Keywords: | WebKit | Cc: | t.lehmann@… |
Description (last modified by )
If I have this text in Notepad:
Line One Line Two
IE renders it as:
<p>Line One</p> <p>Line Two</p>
Chrome renders it as:
<p> </p> <div> Line One</div> <div> Line Two</div>
Update:
- FF3, FF4, Opera - use br to keep formatting. This is from CKEditor 3.0
- Webkit uses divs to keep formatting. This is from CKEditor 3.2.1
- IE (all versions) use <p> tags for pasted text.
Attachments (1)
Change History (11)
comment:1 Changed 14 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 14 years ago by
Component: | General → Core : Pasting |
---|---|
Keywords: | WebKit added |
comment:3 Changed 14 years ago by
Cc: | t.lehmann@… added |
---|---|
Keywords: | chrome safari copy paste div empty added |
Something very similar occures if you do this:
1) Start the CKeditor (current demo) and clean all content (press Del/Bcksp multiple times on the obviously empty editor to ensure all content is gone) 2) Type serveral characters and press enter 3) Mark the first and second line and copy the text to the clipboard (containing text with one linebreak) 4) Paste the text into the second (empty) line 5) (optionally) Repeat step 4 multiple times -> All DIVs get encapsulated within the previous "lines" div (if done step 5) -> (All) the DIV(s) have odd styles
Reproducable with Chrome 8.0 and Safari 5.0.1 (Windows XP).
Firefox does a similar thing when reproducing the above steps but instead pasing SPANs with styles. This also happens if pasting text Firefox cutted in Chrome.
I was actually debugging FCKEditor 2.6.2 having the same problem and tried to see if CKeditor has fixed this. (Un)fortunately not. :) And no: I can't upgrade - too much effort.
My only workaround for now is to run clean-up code iterating each child of the body and converting text child nodes of DIVs to P-tags on every paste.
IIRC the block-splitting code of the dom-range class does similar things.
comment:4 Changed 13 years ago by
Keywords: | chrome safari copy paste div empty removed |
---|---|
Version: | 3.4.1 → 3.0 |
comment:5 Changed 13 years ago by
Description: | modified (diff) |
---|
This is Webkit pasting problem and also our problem.
When you paste something from Notepad in Webkit or when you paste HTML it gets wrapped in Divs. When you have your enter mode set to default ENTER_P (paragraph) those Divs get pasted inside this paragraph.
This can be confirmed when looking at elements path and when viewing the code with Chrome developer tools (Please check the attached screen.png)
This invalid code gets fixed when switching to source or getting the data from editor (when HTML data processor is called). That is why users get impression that extra p is added.
NOTE: This will be fixed in version 4 of editor which will soon be introduced.
Changed 13 years ago by
Attachment: | screen.png added |
---|
comment:6 Changed 13 years ago by
comment:9 Changed 12 years ago by
Issue mentioned in ticket description was fixed in v4 by our custom, so called "textHtmlification". Results in all browsers should now be similar (if not identical) to each other.
comment:10 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
This issue is not reproducible any more. It was fixed by HTML pastebin introduced in 4.0 beta.
Looks like BOM issue.