Add credit for copy code button

This commit is contained in:
Leilukin 2025-02-19 10:21:45 +08:00 committed by Helen Chong
parent 7933feafb0
commit 2e5a71dcb4

View File

@ -1,3 +1,8 @@
/*
Based on ttntm's code to add a button to copy code snippets:
https://ttntm.me/blog/adding-a-copy-button-to-code-blocks/
*/
function createCopyBtn(blockIndex) { function createCopyBtn(blockIndex) {
return `<div class="cc-wrapper d-none d-sm-block"> return `<div class="cc-wrapper d-none d-sm-block">
<button class="cc-btn btn-muted shadow" data-target="${blockIndex}"> <button class="cc-btn btn-muted shadow" data-target="${blockIndex}">