Skip to content

Fix: Pasting from excel inserts an image instead of a formatted table - #8897

Merged
mejo- merged 1 commit into
nextcloud:mainfrom
Dataport:issue/paste-table
Jul 28, 2026
Merged

Fix: Pasting from excel inserts an image instead of a formatted table#8897
mejo- merged 1 commit into
nextcloud:mainfrom
Dataport:issue/paste-table

Conversation

@hiobjan

@hiobjan hiobjan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📝 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

🏚️ Before 🏡 After
B A

🚧 TODO

  • ...

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@mejo- mejo- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Comment thread src/nodes/Image.ts
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hiobjan
hiobjan force-pushed the issue/paste-table branch from 83fb7ba to 7c4e3f3 Compare July 22, 2026 12:11
Signed-off-by: Janina Hiob <user-y5tppt@dev.dataport.de>
Assisted-by: GPT-5.3-Codex
@hiobjan
hiobjan force-pushed the issue/paste-table branch from 7c4e3f3 to 2395c3c Compare July 22, 2026 12:20
@mejo- mejo- self-assigned this Jul 28, 2026
@mejo- mejo- added 3. to review feature: tables bug Something isn't working labels Jul 28, 2026

@mejo- mejo- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot again! I tested it now and it works as expected 🚀

@mejo-

mejo- commented Jul 28, 2026

Copy link
Copy Markdown
Member

/backport to stable34

@mejo-
mejo- merged commit d55be9f into nextcloud:main Jul 28, 2026
61 checks passed
@mejo-

mejo- commented Jul 28, 2026

Copy link
Copy Markdown
Member

/backport to stable33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pasting from excel inserts an image instead of a formatted table

2 participants