MCPcopy Create free account
hub / github.com/block/buzz / extractLanguage

Function extractLanguage

desktop/src/shared/ui/markdown/CodeBlock.tsx:47–51  ·  view source on GitHub ↗
(className?: string)

Source from the content-addressed store, hash-verified

45}
46
47export function extractLanguage(className?: string): string {
48 if (typeof className !== "string") return "";
49 const match = className.match(/language-(\S+)/);
50 return match ? match[1] : "";
51}
52
53function stripDiffMarker(tokens: ThemedToken[], marker: RegExp): ThemedToken[] {
54 const last = tokens[tokens.length - 1];

Callers 1

createMarkdownComponentsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected