![datagrip copy with headers datagrip copy with headers](https://raw.githubusercontent.com/splitgraph/splitgraph.com/master/content/docs/0700_integrating-splitgraph/images/datagrip/4-solution-manage-shown-schemas.png)
This was made obsolete some time ago by the HTML clipboard.
![datagrip copy with headers datagrip copy with headers](https://images.tips.net/S02/Figs/T2696F2.png)
I want t fix that and a direct approach is to not differentiating the single cell case for the HTML version, but only for the text version.īut I'm starting to consider removing all the quoting altogether. This is due to not attaching the HTML version but only the unquoted text version of the cell data. With my last commit for this issue ( 65c670a) the copy and paste inside the application is broken for multi-line cells. If we want to allow cell text with double quotes, tabs and newlines inside cell text, some escape mechanism is needed. This is what Excel and probably other applications are doing. End the cell when the final single double-quote is found, removing it from the ouput.Replace pairs of double quotes by a single double-quote.Do not consider tabs and newlines as delimiters, but as regular characters.If the cell starts with a double quote then:.The algorithm to unescape the cell texts is: For pasting as a single cell text, use the Cell Editor. Paste single multiple line text Newlines are row delimiters, so the text is pasted to different lines when Multiple cell copy Same as single cell copy w/header Single cell copy w/header Whenever the cell contains double quotes, tabs or new-lines, theĮntire cell is quoted in "" and whatever double quote is found is doubled Single cell copy Do not perform any escaping MimeData->setHtml(htmlResult + and How do you see this for a commit? We also need to quote when there are tabs in the string (or replace the tabs by spaces, that's what in the text, again for spreadsheet compatability. TODO: Do we really want to do this for the non-internal buffer case? The only case where we should definitely quote the data is when there are line breaks
![datagrip copy with headers datagrip copy with headers](https://resources.jetbrains.com/help/img/idea/2021.2/db_structure_tool_window_operations.png)
+ result.append(headerText) // We don't need quotes for the column -277,11 +277,14 void ExtendedTableWidget::copy(const bool withHeaders) result.append(QString("\"%1\"").arg(headerText)) // TODO: Check if we need the quotes here QString headerText = model()->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString() 242,11 +242,11 void ExtendedTableWidget::copy(const bool withHeaders)