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

Function toggleCodeBlockFold

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

Source from the content-addressed store, hash-verified

60}
61
62export function toggleCodeBlockFold(button: HTMLButtonElement): boolean {
63 const block = button.closest<HTMLElement>(`.${CODE_BLOCK_CLASS}`)
64 if (!block) return false
65
66 const folded = block.getAttribute(CODE_BLOCK_FOLDED_ATTR) !== 'true'
67 applyCodeBlockFoldState(block, folded)
68 persistCodeBlockFoldState(block, folded)
69 return true
70}
71
72function ensureCodeBlockWrapper(pre: HTMLPreElement): HTMLElement {
73 const parent = pre.parentElement

Callers 3

onClickFunction · 0.90
onClickFunction · 0.90

Calls 2

applyCodeBlockFoldStateFunction · 0.85

Tested by

no test coverage detected