hackmd-io-issues icon indicating copy to clipboard operation
hackmd-io-issues copied to clipboard

code block copy to clipboard button

Open cellcoresystems opened this issue 5 years ago • 5 comments

Is your feature request related to a problem? Please describe. I really would love to have a copy to clipboard button on every code block on the upper right/left corner.

Describe the solution you'd like For example :o) prismjs - copy to clipbord clipboardjs -smaller lightweight

Describe alternatives you've considered From clipboardjs.com A browser extension that adds a "copy to clipboard" button to every code block on GitHub, MDN, Gist, StackOverflow, StackExchange, npm, and even Medium.

Install for Chrome and Firefox.

cellcoresystems avatar Apr 05 '20 23:04 cellcoresystems

ping?

wft44maqb avatar Aug 15 '21 11:08 wft44maqb

ping?

joshlopes avatar Nov 17 '22 13:11 joshlopes

ping?

tlambert03 avatar Feb 25 '24 13:02 tlambert03

Please add this soon. Or at least a way to manually enable it for certain code blocks

AndrewHess avatar May 26 '24 03:05 AndrewHess

參考別人的 user script 改了一版。

安裝方法:

  1. 瀏覽器安裝 Tampermonkey (篡改猴) 擴充套件 https://www.tampermonkey.net/
  2. 前往與安裝 HackMD Copy Code Snippet https://greasyfork.org/zh-TW/scripts/506037-hackmd-copy-code-snippet

已知 bug:如果在編輯模式,新增的程式碼區塊不會有 Copy 按鈕,需要重新載入網頁才會出現。

planetoid avatar Aug 31 '24 09:08 planetoid