mdx-editor / mdx-editor/editor
[BUG] Copy-pasting tables into table cells is still possible and produces messed-up markdown.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
- I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- I have read the documentation and cannot find an answer.
Describe the bug
Copy-pasting tables into table cells is still possible and produces messed-up markdown.
To Reproduce
- Go to https://mdxeditor.dev/editor/demo
- Insert a table
- Copy some content from an other page containing a table, or a table from Excel (with Ctrl+C)
- Put the cursor inside one table cell in the markdown editor
- Paste the content (Ctrl+V)
- Check the markdown (source) view and observe the broken syntax
Expected behavior
There are different ways how this could work
- The table is cut out from the pasted content so only the non-table part is pasted.
- The pasted content still contains the table but is pasted after the originally targeted table
- A separate HTML extension is installed where it uses html tables instead of the GFM table syntax, which supports table nesting (but I imagine it is significantly more tedious to do than the others).
Screenshots
Desktop (please complete the following information):
- OS: [e.g. MacOS, Windows] - MacOS
- Browser: Chrome, Firefox
Additional context
Please do not disable table copy-pasting in general to fix this, copy-pasting tables from excel or html is a fantastic feature.
I have found this related issue which was fixed by disabling the table button: https://github.com/mdx-editor/editor/issues/686
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the editor demo and reproduce the paste sequence with a copied HTML or Excel table, then inspect the markdown source view for the malformed table syntax. The issue lists several possible behaviors but does not choose one, so confirm the intended outcome before changing paste handling; done means table pasting no longer creates broken nested markdown while table pasting remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, react, typescript
- Domain
- content, frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100