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

Function CodeMdx

website/app/components/code/Code.tsx:149–162  ·  view source on GitHub ↗
(props: CodeProps)

Source from the content-addressed store, hash-verified

147};
148
149export const CodeMdx = (props: CodeProps) => {
150 const language = getLanguageFromClassName(props.className);
151
152 if (language === '')
153 return <MantineCode className={classes['inline-code']} {...props} />;
154
155 const code = props.children?.toString().trim() ?? '';
156
157 return (
158 <CodeWrapper language={highlightLanguage(language)} code={code}>
159 <CodeHighlight code={code} language={language} />
160 </CodeWrapper>
161 );
162};
163
164interface CodeDirectProps extends CodeProps {
165 language: string;

Callers

nothing calls this directly

Calls 3

highlightLanguageFunction · 0.90
getLanguageFromClassNameFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected