Skip to content

Copying text from inline code in the Markdown editor includes the backticks #4269

Open

Description

@JammingBen

Bug Description

Copying a selection that lies entirely inside inline code in a .md file puts the code span's Markdown on the clipboard (text/plain), including the backticks. Pasted into a shell, the backticks are treated as command substitution, so the copied command runs and its output is then executed as another command.

Copying from inside a code block already gives the raw text without fences (#3969). Inline code should behave the same way.

Reproduction Steps

  1. Create a .md file with this content:
    Run `pnpm install` now.
  2. Select only pnpm install (inside the code span) and copy it.
  3. Paste into a plain text field or terminal.

Expected Outcome

The clipboard contains pnpm install.

Actual Outcome

The clipboard contains pnpm install.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions