MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / copyCodeBlockToClipboard

Function copyCodeBlockToClipboard

packages/app-core/src/lib/code-block-copy.ts:53–60  ·  view source on GitHub ↗
(button: HTMLButtonElement)

Source from the content-addressed store, hash-verified

51}
52
53export 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
62export function toggleCodeBlockFold(button: HTMLButtonElement): boolean {
63 const block = button.closest<HTMLElement>(`.${CODE_BLOCK_CLASS}`)

Callers 3

onClickFunction · 0.90
onClickFunction · 0.90

Calls 3

writeClipboardTextFunction · 0.85
setCopyButtonFeedbackFunction · 0.85

Tested by

no test coverage detected