Skip to content

Copying in the Markdown editor includes the surrounding blocks and breaks tables on paste #3969

Closed

Description

@JammingBen

Bug Description

Copying a selection in a .md file puts the Markdown of all parent blocks on the clipboard, not just the selected content:

Selection Copied text (text/plain)
hello inside a table cell a whole table: | | / | --- | / | hello |
item inside a list item - item
code inside a code block the code including the fences (#3579)

Pasting the copied table text into another table cell corrupts the table.

Reproduction Steps

  1. Create a .md file with this content:
    | Head                 |
    | -------------------- |
    | hello **bold** world |
    | target               |
  2. Select hello and copy it.
  3. Place the cursor at the end of target and paste.

Expected Outcome

The cell reads targethello. Copying text from inside a block copies only that text.

Actual Outcome

The pasted table is merged into the existing table.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions