Copy to clipboard on Code Block

Hey, as the title says I think it would be very helpful to display a button to copy to clipboard on code blocks.
Sample usage would be of course copying and pasting to a terminal…
I don’t think that would need to be enabled by default but could be under a toggle in settings for people who need it.
EDIT: Forgot to mention that my personal opinion is that having the possibility to enable the button is a lot better the Right Click->Copy Code Block. I don’t know, maybe you can poll this feature somehow :slight_smile:

5 Likes

Hi there,

Many thanks for taking the time to leave a post with some feedback for us here.

I can see that this is your first time posting on the forum, so welcome to the community!

Regarding the above, may I just ask are you wanting to copy the code block format? or just the text from it?

If it’s the latter, you can right click and “copy code” or use the Command+C and Command + V to copy and paste.

If you mean copying the code block format, i’ll pass on this suggestion to the development team to consider when moving forward.

Hello,
As you can see in the following screenshot taken from a GitHub rendered markdown file, when hovering the code block a button appears. On click the text is copied to the clipboard for easy pasting into a terminal for example. I think the user experience is greatly improved having something similar, as I found that, right clicking and finding the entry in the menu to copy the code block not too good.

Ah, I see what you mean.

Thank you for the additional explanation and image.

I’ll pass on the suggestion to the development team to consider :slight_smile:

2 Likes

Please add my +1 vote on that feature request :slightly_smiling_face:

Add my vote too, specifically for iPadOS to have this. It seems like such a common feature in forums, as well as some coding websites like GitHub. Anyways, please add this.

Yes I’ll add my vote too. I think it would be essential to be able to quickly copy the contents of a code block (without the backticks and language identifier; just the contents) on all platforms. I think there’s already a ‘Copy Code Block’ option in Mac’s Menubar but it’s not available on iOS and iPadOS.

Vote has been added :slight_smile:

Vote has been added :slight_smile:

Thank you for your feedback, your vote has been added :slight_smile: