Click to copy inline code span to clipboard #2856
Zak Siddiqui opened 4 weeks ago

Currently, users can copy the contents of a code block by clicking the copy button on the top right of the code block.

This is when viewing (not editing):

  1. Issue description
  2. PR Description
  3. Comments
  4. Anywhere that accepts markdown, really.

However, no such functionality exists for a code span.

Code spans are just as important to be able to copy because they contain highly specific words that are important to duplicate exactly. The ability to click on the code span and have it copied to the clipboard provides the user with an immediate way to reuse that code span.

I can be copied in view mode

I can't be copied in view mode

Proposal

When the mouse hovers over a code span:

  1. Turn the cursor into a pointer to indicate a possible action (the action being "copy to clipboard")

When the mouse clicks on a code span (without dragging):

  1. Copy the code span to the clipboard.
  2. Have the background color of the code span flash a different color briefly (e.g., for 150ms) as a non-disruptive visual hint that the copy action has taken place.
1/1
Type
New Feature
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2856
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover