Copying and pasting web pages sometimes results in crammed together and unformatted text




10 years ago
5 years ago


(Reporter: trash0990, Unassigned)


(Depends on: 1 bug)

1.9.2 Branch
Windows XP
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(2 attachments)



10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)

I do a lot of copying tables from web pages and pasting them into Microsoft Word. These are mainly from financial institutions, for example a transaction history report. Whenever I copy from internet explorer, the tables maintain their format when I paste them into Word, however, every version of Firefox I have tried copying from does not work. When pasted, the the tables are just crammed onto the page with no formatting at all. Websites that I know this effects: Compassbank, Scottrade, Emigrantdirect, and Dollarsavingsdirect. 

Reproducible: Always

Steps to Reproduce:
1.Get a listing of transaction history from financial website.
2.Highlight transaction history table and press CTRL + C.
3.Go to MSWord and press CTRL + P. 

Actual Results:  
If using internet explorer, the exact table is reproduced onto your Word page. If using firefox, all the text is copied without formatting and crammed together. 

Expected Results:  
I would like firefox to mimic internet explorer so that I do not have to use internet explorer. 

This is a normal install of firefox with no addons or themes installed.

Comment 1

10 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20091016 Firefox/3.5.4

Happens to me too. I work with bugzilla in firefox, and sometimes I have to copy and paste filter results (tables) to MS Outlook, and send them by email. When I paste from firefox, all the data is pasted in to one line without any format. I have to open IE7 every time I have to copy and paste from the web.

Comment 2

9 years ago
This is still an issue, nearly a year later as of Firefox 3.6.8.

Comment 3

8 years ago
Reporter -> Are you still experiencing this issue with the latest version of Firefox 3.6.13? Does the issue occur with the latest nightly?

Please provide a URL for a site that exhibits the issue.
Version: unspecified → 3.6 Branch

Comment 4

8 years ago
This reproduces in FireFox 4b12.
Go to about:support, select the Hardware Acceleration table at the bottom, press Ctrl+C, open Notepad, press Ctrl+V - One line of text with no spaces between the cells/new lines between the rows.
Related/duplicated issues -

Comment 6

8 years ago
Were you able to try the extension?

Comment 7

8 years ago
I have used this addon, however it is only partially helpful. This addon will only allow you to copy the whole table, a single row, or a single column. There are many time when I want to copy more than one row of a table but not the entire table and it doesn't allow for that. That would seem like a common desire and I don't know why it would be more difficult to implement than copying only one row.

Comment 8

8 years ago
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5?
Component: General → Widget: Win32
Product: Firefox → Core
QA Contact: general → win32
Version: 3.6 Branch → 1.9.2 Branch

Comment 9

8 years ago
I just tried it with Firefox 5 and, yes, I am still experiencing this. Is this just some crazy hard thing to program for? I admit I have no idea how to program this kind of stuff, but I am assuming there are users out there that do.


8 years ago
Whiteboard: [dupeme?]
Assignee: nobody → netzen
Marking as NEW since I can reproduce. 

This sounds like an issue with the way we generate CF_HTML.  We probably aren't specifying enough context in our StartHTML/EndHTML properties in the CF_HTML format.
Ever confirmed: true
Update: I found that HTML tables do copy/paste correctly.
The problem is that we don't support CF_HTML format with XHTML pages. 

Fix pending.
Summary: Copy and paste of web page tables does not format correctly into MSWord. → XHTML pages are not generating CF_HTML correctly
Whiteboard: [dupeme?]
Summary: XHTML pages are not generating CF_HTML correctly → XHTML pages are not generating CF_HTML
Duplicate of this bug: 572543
See Also: → bug 487023
See Also: → bug 270145
Component: Widget: Win32 → Serializers
QA Contact: win32 → dom-to-text
Moved over the CC list from the bug I marked a duplicate of this bug.
The problem seems to stem from Bug 270145 which treats XHTML as plaintext so that the CDATA portions of the XHTML document can be read.  The fix I'll do here is an alternate fix to 270145 that will allow CF_HTML even if the source XHTML document has CDATA sections.
Brian, are you still working on this?  We noticed this problem while fixing 723163 -- at least I think it's the same problem, because I'm not sure what CF_HTML is.  The problem we found is that nsHTMLCopyEncoder doesn't generate text/html for XHTML documents.
Nope I'm not currently working on this. Unassigned myself.
Assignee: netzen → nobody
I filed bug 857915, which is about generating a text/html encoding when you copy XHTML.  I thought about using this bug instead, but it's not clear from the original report that this is a problem specific to XHTML, even though the bug has become about XHTML.  Or if the "formatting" in comment 0 means plain text pretty printing or HTML style and markup.  (So I'm also changing the summary to better reflect the original report.)

HTML copies and pastes fine in both text/plain and text/html flavors as far as I can tell.  XHTML has two problems: there's no text/html flavor generated, and in the text/plain flavor the text is all smushed together.  Bug 723163 fixed the second problem, and bug 857915 is about the first problem.  So I'll mark this bug as depending on both.
Depends on: 723163, 857915
Summary: XHTML pages are not generating CF_HTML → Copying and pasting web pages sometimes results in crammed together and unformatted text


6 years ago
Duplicate of this bug: 903845

Comment 21

6 years ago
Is bug 319141 a dupe of this one?
They're basically about the same thing.  Bug 319141 describes its problem much more technically.  This bug encompasses a couple of bugs, bug 723163 and bug 857915.  If anything, bug 857915 may be a dupe of bug 319141.  I hesitate to dupe bugs that are vaguely about the same thing but not quite because it can make people mad.

Comment 23

5 years ago
What is the status of this bug? Is this bug still pending? 

Would be nice  to be able to use this feature of copy and pasting the background along with table formatting like Chrome.
You need to log in before you can comment on or make changes to this bug.