MCPcopy Create free account
hub / github.com/adobe/react-spectrum / CodeBlockBase

Function CodeBlockBase

packages/dev/s2-docs/src/CodeBlock.tsx:177–189  ·  view source on GitHub ↗
({children, lang}: {children: string; lang: string})

Source from the content-addressed store, hash-verified

175}
176
177export function CodeBlockBase({children, lang}: {children: string; lang: string}) {
178 // @ts-ignore
179 let highlighted = highlight(children, Language[lang.toUpperCase()]);
180 return (
181 <pre className="m-0">
182 <code
183 className="source"
184 style={{fontFamily: 'inherit', WebkitTextSizeAdjust: 'none'}}
185 dangerouslySetInnerHTML={{__html: highlighted}}
186 />
187 </pre>
188 );
189}
190
191interface TruncatedCodeProps extends ICodeProps {
192 children: string;

Callers

nothing calls this directly

Calls 1

highlightFunction · 0.85

Tested by

no test coverage detected