Skip to content

Add copy button to code blocks in Markdown preview #322269

Closed

Description

Problem
There's currently no easy way to copy a code block from the rendered Markdown preview — you have to manually select the text, which is fiddly and easy to get wrong (e.g. accidentally including line numbers or surrounding text).

Proposal
Add a hover-triggered copy icon/button on each fenced code block (```) in the Markdown preview, similar to how GitHub, GitLab, and most documentation sites handle it. Clicking it copies the raw code content to the clipboard.

Scope
This applies specifically to the built-in Markdown preview (markdown-language-features extension) — not the Markdown source editor itself.

Additional context
Happy to put together a prototype/PR for this if the team is open to it.

Activity

  1. KrushnaAsDeveloper commented on Jun 22, 2026

    @KrushnaAsDeveloper
    Author

    PR #322274 by Harihar Jeevan (@hariharjeevan) is addressing this — tracking it here.

  2. added
    feature-request
    markdown-ext
    on Jul 7, 2026
  3. hediet commented on Jul 7, 2026

    @hediet
    Member

    This is a recording of the feature:

    Image
  4. added
    unreleased
    on Jul 28, 2026
  5. added
    insiders-released
    verification-needed
    and removed
    unreleased
    on Jul 29, 2026
  6. locked and limited conversation to collaborators on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedmarkdown-extverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions