Bug 13222 - Copying and Pasting a Table into Text Editor produces mangled text
Summary: Copying and Pasting a Table into Text Editor produces mangled text
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: GoogleBug, InRadar
Depends on:
Blocks:
 
Reported: 2007-03-28 20:49 PDT by Elliott Sprehn
Modified: 2008-12-01 12:52 PST (History)
3 users (show)

See Also:


Attachments
Unmangled output from TextEdit.app (872 bytes, text/plain)
2007-03-28 20:52 PDT, Elliott Sprehn
no flags Details
Mangled Output from TextWrangler.app, also occurs in SimpleText.app example (872 bytes, text/plain)
2007-03-28 20:53 PDT, Elliott Sprehn
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 2007-03-28 20:49:22 PDT
Copying a table (such as the search results from bugs.webkit.org) into TextWrangler or the example application that comes with XCode called SimpleText ( /Developer/Examples/Carbon/SimpleText ) generates mangled text.

Instead of the data being separated by tabs its broken across many lines as if both the row separators and  the column separators were replaced with new lines.

If pasting into a TextEdit or other editors the table appears properly formatted as tab separated data with one line per row.

Reproducable with Safari 2.0.4 and the current nightly.
Comment 1 Elliott Sprehn 2007-03-28 20:52:24 PDT
Created attachment 13856 [details]
Unmangled output from TextEdit.app
Comment 2 Elliott Sprehn 2007-03-28 20:53:37 PDT
Created attachment 13857 [details]
Mangled Output from TextWrangler.app, also occurs in SimpleText.app example
Comment 3 Andrey Tverdokhleb 2007-08-08 10:16:16 PDT
Devs!? Anybody?! 
The bug is really old - Safari always worked this way and it was always a problem to copy/paste an html table to Excel from WebKit based applications. Now Apple has it's own spreadsheet Numbers, but it has exactly same problem. Please fix this - makes it really hard to use Safari for those of us who needs to cut data from web! I mean - REALLY HARD!
BTW - Firefox, Camino, IE all behave properly in this case. 
Comment 5 Andrey Tverdokhleb 2007-08-08 11:58:32 PDT
Ok, apparently it behaves depending on sites and application you pasting to.
F.e. this table 

http://lists.macosforge.org/pipermail/webkit-dev/ 

when copied from Safari and pasted to Numbers looks like a single column table, 
but when I copy/paste it from Camino it looks right in Numbers.  
Works ok with plain text apps though.

In plain text applications some tables look right when pasted from Safari and some don't. F.e.

http://www.microsoft.com/technet/security/Bulletin/MS07-003.mspx?pf=true

Any table from this link pastes improperly to both plain text apps and Numbers apps.
Comment 6 Andrey Tverdokhleb 2007-08-08 12:13:01 PDT
Safari 3.0.3 (522.12.1)
Comment 7 David Kilzer (:ddkilzer) 2007-08-10 04:38:49 PDT
<rdar://problem/5400981>
Comment 8 Justin Garcia 2008-05-27 17:12:04 PDT
I copied http://lists.macosforge.org/pipermail/webkit-dev/ and tried pasting it into Numbers.  I made a change to WebCore to keep it from putting RTF on the pasteboard and the problem went away.  So, Numbers seems to prefer RTF, but it doesn't understand RTF tables.  Either that or RTF tables are malformed.  Asking the AppKit folks about this...
Comment 9 Jon@Chromium 2008-12-01 12:52:31 PST
You can repro this problem by copying from Google Spreadsheets into Excel or OpenOffice Calc.  IE7 and FF3 are able to copy and paste successfully.  

Also reported against Chromium.  See bug http://code.google.com/p/chromium/issues/detail?id=3827