(e: MouseEvent)
| 96 | if (!root || !html) return |
| 97 | |
| 98 | const onClick = (e: MouseEvent): void => { |
| 99 | const target = e.target as HTMLElement |
| 100 | const copyButton = target.closest<HTMLButtonElement>(CODE_COPY_BUTTON_SELECTOR) |
| 101 | if (copyButton) { |
| 102 | e.preventDefault() |
| 103 | e.stopPropagation() |
| 104 | copyCodeBlockToClipboard(copyButton) |
| 105 | return |
| 106 | } |
| 107 | |
| 108 | const foldButton = target.closest<HTMLButtonElement>(CODE_FOLD_BUTTON_SELECTOR) |
| 109 | if (foldButton) { |
| 110 | e.preventDefault() |
| 111 | e.stopPropagation() |
| 112 | toggleCodeBlockFold(foldButton) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | root.addEventListener('click', onClick) |
| 117 | return () => root.removeEventListener('click', onClick) |
nothing calls this directly
no test coverage detected