MCPcopy Create free account
hub / github.com/anomalyco/opencode / disposeCopyButtons

Function disposeCopyButtons

packages/session-ui/src/components/markdown.tsx:164–172  ·  view source on GitHub ↗
(root: Element)

Source from the content-addressed store, hash-verified

162}
163
164function disposeCopyButtons(root: Element) {
165 const hosts = [
166 ...(root instanceof HTMLElement && root.getAttribute("data-slot") === "markdown-copy-button" ? [root] : []),
167 ...Array.from(root.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(
168 (el): el is HTMLElement => el instanceof HTMLElement,
169 ),
170 ]
171 hosts.forEach(disposeCopyButton)
172}
173
174const shellLanguages = new Set(["bash", "sh", "shell", "zsh", "fish", "console", "terminal"])
175

Callers 4

setupCodeCopyFunction · 0.85
MarkdownFunction · 0.85
updateBlockFunction · 0.85
updateCodeBlockFunction · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected