Fix: Pasting from excel inserts an image instead of a formatted table - #8897
Conversation
mejo-
left a comment
There was a problem hiding this comment.
Thanks a lot @hiobjan for the contribution, much appreciated. The code changes look good to me. I have one comment, but it's not blocking.
The failing Playwright test is unrelated, you can ignore it.
To put the PR into a mergeable state, can you please do the following:
- squash all commits into one commit. https://stackoverflow.com/questions/1657017/how-to-squash-all-git-commits-into-one describes how to do that.
- given that the code changes were assisted by AI, make sure the commit message contains the
Assisted-Byfooter, as described in our AI Policy. You can add the trailer for the last Git commit withgit commit --amend --trailer "Assisted-by: AGENT_NAME:MODEL_VERSION"
| return false | ||
| } | ||
|
|
||
| // Check if the pasted content contains a table, either in HTML or TSV-like format. If so, let the regular paste pipeline handle it. |
There was a problem hiding this comment.
I wonder whether we should let the regular paste pipeline handle it whenever HTML or text paste data is non-empty, but I'm not sure here. Do others have knowledge here and have an opinion on whether this is a good idea @max-nextcloud @skjnldsv @susnux @ShGKme?
To give some context: the handlePaste function here takes care of inserting pasted images. Unfortunately, copying data from Microsoft Excel will put a screenshot of the copied data into event.clipboardData.files, I guess to ensure compatibility with pasting the copied content into places that cannot deal with the table data.
83fb7ba to
7c4e3f3
Compare
Signed-off-by: Janina Hiob <user-y5tppt@dev.dataport.de> Assisted-by: GPT-5.3-Codex
7c4e3f3 to
2395c3c
Compare
mejo-
left a comment
There was a problem hiding this comment.
Thanks a lot again! I tested it now and it works as expected 🚀
|
/backport to stable34 |
|
/backport to stable33 |
📝 Summary
Added a check if the pasted content contains a table, either in HTML or TSV-like format. If so, let the regular paste pipeline handle it.
🖼️ Screenshots
🚧 TODO
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)