GNOME Bugzilla – Bug 143084
cut/paste text/html
Last modified: 2010-06-25 13:00:01 UTC
pasting from gnumeric into another app as text/html shouldn't paste a complete html document, it should just paste the table markup.
It is not clear that this is a bad thing, and also not clear what else to do. OpenOffice, Gnumeric and Abiword all wrap the table inside an html document. Mozilla is the only application I know about which does not.
If I'm working on an html document, and want to insert some data from a spreadsheet, I may just think "great I can just cut/paste from gnumeric". Then you end up with a complete document getting pasted into the one you are working on, which just seems very odd behaviour. Likewise for pasting some text from a word document.
I see where you're coming from. It's certainly a valid usecase. As a workaround, you could in fact save as html fragment, and insert the file into your editor buffer. The consumer of the clipboard could be either a progam or a human. We do not know how smart the program is going to be. If the program expects content marked text/html to be - well - text/html, that seems reasonable to me. But many programs do in fact try to make sense of programs. Gnumeric is one of these. Unfortunately, the meaning of text/html on the clipboard is not well specified. There has been some discussion, see e.g. the thread starting at http://freedesktop.org/pipermail/xdg/2003-December/003077.html but no specifications yet, not even a draft. Do you want to write one? Personally, I think markup fragments on the clipboard make sense. But I don't think it is correct to call them text/html. Until there is a standard to implement, this is probably a NOTABUG. But that's the maintainer's call. And feel free to restart the discussion at xdg@freedesktop.org.
NOTABUG seems like a reasonable call here, but lacking an explicit standard I'll leave this open as a placeholder.
Is there really any use case where we would want to paste a full html document from gnumeric?
Pasting to a browser perhaps.
fyi - abiword expects a full HTML document. i'd agree with Jon that this is NOTABUG until there's some sort of reasonable standard to conform to.
Microsoft has specified how they do HTML on the Windows clipboard. See http://msdn.microsoft.com/workshop/networking/clipboard/htmlclipboard.asp It's a full HTML document preceded by some headers. The fragment the user chose is indicated by a header before the document and comments inside it. E.g.: Version:0.9 StartHTML:71 EndHTML:170 StartFragment:140 EndFragment:160 StartSelection:140 EndSelection:160 <!DOCTYPE> <HTML> <HEAD> <TITLE>The HTML Clipboard</TITLE> <BASE HREF="http://sample/specs"> </HEAD> <BODY> <!--StartFragment --> <P>The Fragment</P> <!--EndFragment --> </BODY> </HTML>
*** Bug 308387 has been marked as a duplicate of this bug. ***
Note that the link of comment #8 is no longer valid.
This should really be solved as part of bug #34632 *** This bug has been marked as a duplicate of bug 34632 ***
HTML Clipboard Format: http://msdn.microsoft.com/en-us/library/ms649015%28VS.85%29.aspx