Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Pasting multi-line cells from Excel inserts a carriage return and spaces #6258
Pasting a cell from Excel which contains multi-line text adds a carriage return after the first word of the first line. It also inserts extra spaces. While you can't see it in the screenshot below, if you edit the cell in handsontable, you will see spaces added to the beginning of each new line.
The pasted text in handsontable should retain the same formatting as Excel.
I believe this issue reported previously is exactly the same problem
I debugged the code in handsontable.full.js where it performs paste actions.
Here is an excerpt from the HTML from the clipboard after copying from Excel:
Notice how after the first "Line" word, there is a carriage return to the next line. This seems to reflect in the pasted text in handsontable. You seem to be using both a carriage return and the
Commenting some code as suggested here resolves the issue - #5647 (comment) But I assume the commented code is needed for other use cases.
Also please note this problem does not occur if copying from Google Sheets, since the HTML in the clipboard is a different format.
Steps to reproduce
Not possible to demo without using Excel. You can download a trial from Microsoft - https://products.office.com/en-gb/excel
@AMBudnik thats good you can also replicate. Thanks.
It seems these issues are related to the ability to paste in text/html data type which I see was introduced here - #4931
Can you give me some examples of use cases where someone would want to paste as text/html? Because pasting as text/plain appears to solve most of my problems with pasting from Excel.
The latest build of