(button: HTMLButtonElement)
| 51 | } |
| 52 | |
| 53 | export function copyCodeBlockToClipboard(button: HTMLButtonElement): boolean { |
| 54 | const text = getCodeBlockTextForCopyButton(button) |
| 55 | if (text == null) return false |
| 56 | |
| 57 | const copied = writeClipboardText(text) |
| 58 | setCopyButtonFeedback(button, copied ? 'copied' : 'failed') |
| 59 | return copied |
| 60 | } |
| 61 | |
| 62 | export function toggleCodeBlockFold(button: HTMLButtonElement): boolean { |
| 63 | const block = button.closest<HTMLElement>(`.${CODE_BLOCK_CLASS}`) |
no test coverage detected