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

Function highlightCodeSpan

src/common/syntax-highlighter.ts:345–351  ·  view source on GitHub ↗
(
  code: string,
  grammar?: SyntaxGrammar
)

Source from the content-addressed store, hash-verified

343
344/** Return a style span of the input code */
345export function highlightCodeSpan(
346 code: string,
347 grammar?: SyntaxGrammar
348): StyledSpan[] {
349 const spans = parseCode(code, grammar);
350 return renderCode(spans);
351}
352
353/** Return a style block of the input code, including a
354 * gutter with line numbers and an optional highlighted line

Callers

nothing calls this directly

Calls 2

renderCodeFunction · 0.85
parseCodeFunction · 0.70

Tested by

no test coverage detected