MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / renderCode

Function renderCode

src/common/syntax-highlighter.ts:337–342  ·  view source on GitHub ↗
(spans: CodeSpan[], theme = DEFAULT_THEME)

Source from the content-addressed store, hash-verified

335}
336
337function renderCode(spans: CodeSpan[], theme = DEFAULT_THEME): StyledSpan[] {
338 return spans.map((span) => {
339 const style = { ...theme[span.tag], content: span.content };
340 return style;
341 });
342}
343
344/** Return a style span of the input code */
345export function highlightCodeSpan(

Callers 2

highlightCodeSpanFunction · 0.85
highlightCodeBlockFunction · 0.85

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected