MCPcopy
hub / github.com/npmx-dev/npmx.dev / highlightCodeBlock

Function highlightCodeBlock

server/utils/shiki.ts:137–140  ·  view source on GitHub ↗
(code: string, language: string)

Source from the content-addressed store, hash-verified

135 * @returns HTML string with syntax highlighting
136 */
137export async function highlightCodeBlock(code: string, language: string): Promise<string> {
138 const shiki = await getShikiHighlighter()
139 return highlightCodeSync(shiki, code, language)
140}
141
142/**
143 * Escape raw > characters in HTML text content.

Callers 4

shiki.spec.tsFile · 0.90
renderMarkdownFunction · 0.90
renderMergedSymbolFunction · 0.90
renderJsDocTagsFunction · 0.90

Calls 2

getShikiHighlighterFunction · 0.85
highlightCodeSyncFunction · 0.85

Tested by

no test coverage detected