HTML TABLE clipboard export breaks gmail paste

[expired user #6201]'s profile image [expired user #6201] posted 12 years ago in Import/Export Permalink
There's been some changes to HTML TABLE export recently, which breaks COPY-PASTE into Gmail message.

Steps to reproduce:

1. Select a few data rows
2. Export grid rows
3. Copy to clipboard, HTML table, selection
4. Click [OK]
5. Go to gmail in your browser
6. Open new message
7. CTRL+V clipboard content
8. ... nothing happens


A few versions back (2.8, 2.9?) this worked flawlessly and a html table was inserted into the message. Now, nothing happens.
It's probably because Heidi creates a well-formed HTML document (with <html>,<body> etc.) instead of just the HTML table, which breaks things.

Please consider reverting to old behavior.

Thanks for reading.

Arthur.
ansgar's profile image ansgar posted 12 years ago Permalink
"A few versions back" ? We have HeidiSQL 6.0 and this is already more than one year oldsmileMust be several years ago since I changed that. If I remember right, this was in order to support rich text editors like MS Word, OpenOffice and so on, but as this is so long ago there could easily be more reasons for that change.
ansgar's profile image ansgar posted 12 years ago Permalink
I can also not reproduce that in Gmail nothing happens - Ctrl+V pastes the HTML file source in the editor.
[expired user #6201]'s profile image [expired user #6201] posted 12 years ago Permalink
version - typo, I meant 5.8/5.9

I doubt anyone cares about pasting HTML source. I'm reporting problem pasting into HTML email. You're probably trying to paste HTML into "plain text" message.

In order to reproduce, switch gmail message to "rich text" (default in gmail since last year) and then try to paste the table. Before those 5.8 changes, pasting would result in a nicely formatted table popping inside message body.
jfalch's profile image jfalch posted 12 years ago Permalink
perhaps export dialog could gain a "compact" option checkbox - omit everything around <table> when checked (ie DOCTYPE, html, head, body) ?
[expired user #6201]'s profile image [expired user #6201] posted 12 years ago Permalink
Well, it's called "HTML TABLE", so it should generate a <table>, not a document.

An additional export format, "HTML REPORT" or "HTML DOCUMENT" could be used to generate a full html document.
jfalch's profile image jfalch posted 12 years ago Permalink
a matter of debate. nearly all options on the left side of the "export grid rows" dialog select completely different data formats; this distinction (table/doc) selects two variants of a single data format (HTML). Thus, an additional control selecting the variant appears more logical to me.
There is, however, the something-like-exception SQL INSERT / REPLACE, both of which are variants of the data format SQL ... oh well.
ansgar's profile image ansgar posted 12 years ago Permalink
Pasting HTML into a rich text editor (MS Word, OpenOffice Writer, ...) need a full document in order to keep formatting. But that only applies to the rich text version of the both clipboard contents. The raw content could proably be a simple table, yes, but I need to check that.
[expired user #6201]'s profile image [expired user #6201] posted 12 years ago Permalink
@anse: how about rich-text export then? It should work with both windowze editors and internet browsers... but not sure it can contain tables.
ansgar's profile image ansgar posted 12 years ago Permalink
rich text is already one of two versions in clipboard. Complicated stuff. However, I was talking about the raw version, which I could probably change to only use a table.
stompro2023's profile image stompro2023 posted 1 year ago Permalink

Hello, is there a solution to this issue? I know this is an 11 year old ticket, but I'm not finding any other discussion.

I use google workspaces and would like to be able to paste the html tables directly into the email, but I just get the raw html when I try.

Thanks Josh

ansgar's profile image ansgar posted 1 year ago Permalink

The HTML generated by HeidiSQL's grid export, or what did you use?

If so, you could try to paste it somewhere else first, probably in Word, just to find out if that works.

stompro2023's profile image stompro2023 posted 1 year ago Permalink

Hello ansgar, yes this is about the HTML table export option.

It does work fine to paste into libre office write, word or thunderbird, and then select all and copy into gmail. But I do loose some formatting that way. The header row color gets stripped for instance.

I just really miss the ability to do it directly, it triples the amount of steps it takes and messes up the formatting.

The exporting options are the #1 reason I use Heidi SQL, my main workflow is writing one off reports and sending them to people via email.

Thank you for the reply.

Josh

ansgar's profile image ansgar posted 1 year ago Permalink

Works like a charm here, from HeidiSQL 12.4 to GMail. Perhaps you have unchecked the "include column names" option?

Description

stompro2023's profile image stompro2023 posted 1 year ago Permalink

Wow, this gives me hope.

Using the same export settings, running 12.4.0.6659 64bit, I just get the HTML source pasted when I use ctrl+v to paste. This is on windows 10 also. It is like I'm using the paste as text option, but I'm not.

I get that when I paste into my google workspace email, vanilla gmail and I just tried protonmail and yahoo mail also and get the same thing.

ansgar's profile image ansgar posted 1 year ago Permalink

It's probably also depending on the webbrowser you use. I am using Firefox here. I guess it's Chrome on your side?

stompro2023's profile image stompro2023 posted 1 year ago Permalink

Yes, I was testing with Chrome.

I just tested with firefox and I'm seeing the same behavior though.

But now I cannot even go back and paste into Word for some reason. Now I'm just getting the plain text html when I paste into word.

This seems like it must just be something messed up with my environment. I'll try a different windows profile, and a different machine..... I also make use of VNC for remote admin... maybe that is grabbing the paste buffer and messing with it.

Thank you for the help. Josh

stompro2023's profile image stompro2023 posted 1 year ago Permalink

Closing my VNC session helped a bit. It now works to paste into a gmail compose window in firefox. But chrome still behaves like I'm pasting as plain text.

I'll try turning off all extensions in a new chrome profile... that didn't seem to work.

This seems to have little to do with Heidi SQL, thank you for your help. I can use firefox for sending reports until I can track down what is messing with my chrome paste functionality.

ansgar's profile image ansgar posted 1 year ago Permalink

Feel free to drop me a note when you find something helpful. Probably the HTML from HeidiSQL should be modified in some way.

Seems other Chrome users are having the same issue: https://stackoverflow.com/questions/59507129/how-to-place-html-on-clipboard-that-can-be-pasted-into-gmail

ansgar's profile image ansgar posted 1 year ago Permalink

Got it. I just found the neat InsideClipboard app.

With that, I could see the "HTML Format" clipboard entry contains a wrong position for "StartFragment", when you copy in HeidiSQL. It's currently set to the very start of the HTML code, but it needs to point to the position after the <body> tag. At least that is how Chrome and Firefox do it.

I will push a change for this.

Description

Code modification/commit a7d76c0 from Ansgar Becker <anse@heidisql.com>, 1 year ago, revision 12.4.0.6666
Make HTML export format compatible to Google Chrome. See https://www.heidisql.com/forum.php?t=9893
ansgar's profile image ansgar posted 1 year ago Permalink

Tataa.. an 11 year old bug is fixed now 💪

stompro2023's profile image stompro2023 posted 1 year ago Permalink

Wow, thank you so much. I'll test it out and report back. Josh

Code modification/commit 8592852 from Ansgar Becker <anse@heidisql.com>, 1 year ago, revision 12.4.0.6667
Refactor HTML clipboard code. See https://www.heidisql.com/forum.php?t=9893
stompro2023's profile image stompro2023 posted 1 year ago Permalink

Hello, I just had a chance to upgrade and test it out and it works now to paste into a gmail compose window in chrome on windows. Thank you for fixing that.

I'm using revision 6667 to test, I didn't have a chance to try 6666. The html styling seems to be different now, no more background for the header row. I liked how it looked before, but that isn't a huge deal.

I vaguely remember the sql being included after the table before, and now it seems to be included before the table. But that may be a false memory. I think I preferred the sql after the table (Unless I'm just imagining that change :-) )

Please login to leave a reply, or register at first.