MCPcopy Index your code
hub / github.com/fontsource/fontsource / getLanguageFromClassName

Function getLanguageFromClassName

website/app/components/code/Code.tsx:49–53  ·  view source on GitHub ↗
(className?: string)

Source from the content-addressed store, hash-verified

47};
48
49const getLanguageFromClassName = (className?: string) =>
50 className
51 ?.split(' ')
52 .find((name) => name.startsWith('language-'))
53 ?.replace('language-', '') ?? '';
54
55const getCodeChild = (children: ReactNode) =>
56 Children.toArray(children).find((child) =>

Callers 2

CodePreFunction · 0.85
CodeMdxFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected