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

Function codeLanguage

packages/session-ui/src/components/markdown.tsx:182–186  ·  view source on GitHub ↗
(block: HTMLPreElement)

Source from the content-addressed store, hash-verified

180}
181
182function codeLanguage(block: HTMLPreElement) {
183 const code = block.querySelector("code")
184 if (!(code instanceof HTMLElement)) return
185 return code.className.match(/(?:^|\s)language-([^\s]+)/)?.[1]
186}
187
188function applyCodeMetadata(wrapper: HTMLElement, language: string | undefined) {
189 if (!document.body.hasAttribute("data-new-layout")) {

Callers 1

ensureCodeWrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected