Copy HTML-formatted text

Forums » Opera for Windows/Mac/Linux » Desktop wish-list

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

8. April 2010, 14:23:52

DavidR

Posts: 181

Copy HTML-formatted text

A very simple request: Opera should be able to copy text with HTML-encoded formatting intact, as other browsers do. I realize that this has been requested many times, but I'm asking for it again. My reasons are:
  • I need it for my research work: I have a bibliography manager that can copy data on books and articles from Web pages and create bibliographical records from them, if the information is HTML-formatted. Why should I have to go to IE to do this?
  • We are grown-ups out here. I realize that there is some security risk in copying HTML formatting, but I should be allowed to accept that risk to meet specific needs. If it is made an option that I can select through the Preferences dialogue, that will protect those who need protecting, and enable others to do necessary work in Opera.
  • It is (checking my watch now) 10 years into the 21st century. Rigidly mandating plain-text-only copying leaves Opera stuck in the past, and helps keep it on the fringes of the browser world, instead of in the center, where it belongs.

Thanks for listening. If my reasons reflect some kind of misunderstanding, someone please help me understand better!
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

8. April 2010, 15:41:33

Frenzie

Posts: 15541

Item, "Copy with formatting" = Go to page, "javascript:void(document.designMode='on')" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')"
The DnD Sanctuary — a safety net for My Opera's demise.

8. April 2010, 16:24:33

DavidR

Posts: 181

Sorry for my ignorance, I don't know how to use the code you posted.
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

8. April 2010, 16:33:28

Frenzie

Posts: 15541

This could be pasted in a custom menu.ini, or you could use the macro in a button or keyboard shortcut.

For buttons, use http://nontroppo.org/tools/buttonmaker/

The macro part being
Go to page, "javascript:void(document.designMode='on')" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')"
The DnD Sanctuary — a safety net for My Opera's demise.

8. April 2010, 17:19:33

DavidR

Posts: 181

OK, thanks, I created a button with the macro. When I tried it out, it copied text that I had previously selected to the clipboard. However, it did not seem to copy any formatting (font changes, bold, italic, etc.), just plain text. Maybe this is because I'm still in Opera 9.64.

Sorry to be a bit dense, this is my first time doing anything like this in Opera.
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

8. April 2010, 17:46:51

Frenzie

Posts: 15541

You could try it manually.

If you put this in the addressbar
javascript:void(document.designMode='on')

then you should be able to edit text, copy it with formatting, etc.

If the error console shows an error then you'll have to upgrade to at least Opera 10.0x to use the button correctly.

http://www.opera.com/docs/specs/presto22/ says Presto 2.2 supports it though, which I think is what 9.6x uses?
The DnD Sanctuary — a safety net for My Opera's demise.

8. April 2010, 19:24:38

DavidR

Posts: 181

Very interesting. When I do this, I can edit text on a Web page (which feels amazingly cool); but it still won't copy formatting. According to http://www.opera.com/docs/specs/, Opera v. 9.6x supports Presto 2.1.1. Maybe that's the problem. I'll have to upgrade to v. 10 and see if it works then.
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

8. April 2010, 22:16:35

DavidR

Posts: 181

A follow-up: The HTML 5 document referred to by both the Presto 2.1.1 and the most recent Presto 2.5 pages describes a number of user actions to be implemented when a document or a portion of it is made editable: http://dev.w3.org/html5/spec/Overview.html#user-editing-actions (warning: this is a massive document, and takes ages to download, at least on my machine). It is noteworthy that these do not include anything about copying HTML formatting. I get the impression that Opera is unalterably opposed to such copying, for whatever reason.

So, one more question, Frenzie: using designMode, do you find that you are able to copy HTML-formatted text with the formatting intact? For instance, can you copy such text and paste it into a Word document with fonts, italics, etc., intact?
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

8. April 2010, 23:07:10

BtEO

Posts: 1022

What you actually want is to get RTF data onto the clipboard, not HTML. But Opera doesn't support that currently either. p

The Opera devs rarely comment on whether and when features may or may not be included. You are far from the first person to request this, and Opera have at no point I've seen said they are opposed to it, they're just as silent on it as they almost always are about new and requested features. No matter what happens with Opera there always seems to be a queue of feature requests that have gathered momentum for some time (CSS rounded corners was one of the biggest filled by Opera 10.5.) This is just the nature of development when you don't have an Infinite amount of monkeys and keyboards producing the software equivalent of Shakesphere. The best you can do is keep an eye on the Desktop Team blog and see if one of the snapshots there makes your day; or try and get a job at Opera and influence things from the inside.
MyOpera Community Enhancements — by xErath & BtEO
MyOpera Community Optimizations — by fearphage
Scribit improved posting tools for the MyOpera Community — by xErath
Improve Weeklies Blog — by MisterE & fearphage

9. April 2010, 03:40:56

iamhappy007

Posts: 74

Originally posted by DavidR:

A very simple request: Opera should be able to copy text with HTML-encoded formatting intact, as other browsers do. I realize that this has been requested many times, but I'm asking for it again. My reasons are:

  • I need it for my research work: I have a bibliography manager that can copy data on books and articles from Web pages and create bibliographical records from them, if the information is HTML-formatted. Why should I have to go to IE to do this?
  • We are grown-ups out here. I realize that there is some security risk in copying HTML formatting, but I should be allowed to accept that risk to meet specific needs. If it is made an option that I can select through the Preferences dialogue, that will protect those who need protecting, and enable others to do necessary work in Opera.
  • It is (checking my watch now) 10 years into the 21st century. Rigidly mandating plain-text-only copying leaves Opera stuck in the past, and helps keep it on the fringes of the browser world, instead of in the center, where it belongs.

Thanks for listening. If my reasons reflect some kind of misunderstanding, someone please help me understand better!



+1. I also use IE a lot for this task...

10. April 2010, 17:57:46

DavidR

Posts: 181

Originally posted by BtEO:

What you actually want is to get RTF data onto the clipboard, not HTML. But Opera doesn't support that currently either. p

The Opera devs rarely comment on whether and when features may or may not be included. You are far from the first person to request this, and Opera have at no point I've seen said they are opposed to it, they're just as silent on it as they almost always are about new and requested features. No matter what happens with Opera there always seems to be a queue of feature requests that have gathered momentum for some time (CSS rounded corners was one of the biggest filled by Opera 10.5.) This is just the nature of development when you don't have an Infinite amount of monkeys and keyboards producing the software equivalent of Shakesphere. The best you can do is keep an eye on the Desktop Team blog and see if one of the snapshots there makes your day; or try and get a job at Opera and influence things from the inside.



Sorry, been away for a couple of days. The specific program I want to copy text for actually requires HTML-formatted copying; the fonts and so on were just the quickest thing I could think of to test formatted copying of any kind.

I use other "non-standard" software too, and I understand that developers who don't have Bill Gates behind them have to do triage on what gets added. (And I understand the reasons for not making specific promises.) But I also know that, as you say, this specific feature has been requested by many people for a long time. Really I was just adding my voice to the outcry. smile I also tried to supply something of a rationale in the hope that that might be helpful. Maybe one of these days we'll get lucky.
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

11. April 2010, 09:37:43

Frenzie

Posts: 15541

Originally posted by DavidR:

So, one more question, Frenzie: using designMode, do you find that you are able to copy HTML-formatted text with the formatting intact? For instance, can you copy such text and paste it into a Word document with ]fonts, italics, etc., intact?


Precisely. Or at least in OpenOffice.org Writer. That's what it did for me in 10.0x, and does for me in 10.10 and 10.5x.
The DnD Sanctuary — a safety net for My Opera's demise.

12. April 2010, 13:30:24

DavidR

Posts: 181

OK, thanks! I'll definitely have to give this a try in Opera 10.
Opera 12.14, Build 1738
Windows 7 Pro 64-bit

1. August 2010, 07:29:01

gorodn

This is a joke, yes?

Posts: 263

+10 knight

I know some IE versions can copy HTML formatting natively, and I routinely use the IE5 Power Tweaks in my IE6 to do the same task.

Everybody tells me Opera is a complete internet suite -- so when do we get this feature?

Gordon.
____________________
Sugar, greasy foods and Microsoft are dangerous to your health -- eat, drink and be merry!
____________________
Early to bed and early to rise makes a bloke crook, broke and stupid.
____________________
Opera 9.51, W2K Pro SP4 Rollup 1

2. August 2010, 08:56:04

serious

Lab mouse and likes it!

Posts: 5657

+1, but only if it only copies the markup (tables, bullet-points, paragraphs, ...) and not the style associated with it, too (as IE does)
All my posts only represent my own opinions.
[ Tweedo Monitor - Deluxe Website & Service Monitoring ]

2. August 2010, 13:15:58

s-a-s-h

Posts: 362

Even copying without styles is enough for me. Most important are tables, bullets, bold, italics and so on. It's rare case when you need absolutely all formatting.
Since opera can copy formatting in design mode it must be extremely easy to implement rich copying out of the box. Only copying of images (not urls) needs to be added

2. August 2010, 18:40:28

IKoke

Posts: 466

+1 Please, please

4. August 2010, 00:04:20

HeinrichP

HeinrichP

Posts: 392

It actually haves. I don't remember how to do it, but I used it once to copy a site from the very apple.com to my blog Click here to see the entry
<a href="http://my.opera.com/community/download.pl?ref=HeinrichP&p=opera_desktop"><img src="http://promote.opera.com/myopera/opera.jpg" alt="Download Opera, the fastest and most secure browser"></a>

My Opera Wishlist (scan to see:)
http://bit.ly/heinrichpwishlistqrcode

25. August 2010, 14:41:29

dériRENAMED

Banned user

This will be awesome! Add this to M2 too.
I have IE just for do that...

25. August 2010, 19:19:13

mikerobinson

Posts: 10

+1 to this too. It would be great if you could choose whether or not to copy formatting by adding a right click option.

25. August 2010, 20:59:06

QuHno

read a book!

Posts: 1037

Originally posted by s-a-s-h:


Since opera can copy formatting in design mode it must be extremely easy to implement rich copying out of the box. Only copying of images (not urls) needs to be added

I use the "Copy with format" (same as the one Frenzie posted) Button with 10.61 and it copies images too. Not background (style) images but plain IMG tag images. The styling apart from the font-family and the colors is copied to, H's and A's remain H's and A's at least if I copy them to MS-Office ...
Looking for a new home for your blog, albums, mail and forums after my.opera closes at march 1, 2014?

Visit https://vivaldi.net - the new community set up by Jon S. v. Tetzchner and several former Opera employees. Many of us are already there and some of the employees too smile

27. August 2010, 18:45:56

HeinrichP

HeinrichP

Posts: 392

+1
<a href="http://my.opera.com/community/download.pl?ref=HeinrichP&p=opera_desktop"><img src="http://promote.opera.com/myopera/opera.jpg" alt="Download Opera, the fastest and most secure browser"></a>

My Opera Wishlist (scan to see:)
http://bit.ly/heinrichpwishlistqrcode

Forums » Opera for Windows/Mac/Linux » Desktop wish-list