MCPcopy Create free account
hub / github.com/MagicCube/agentara / createRawTokens

Function createRawTokens

web/src/components/ai-elements/code-block.tsx:159–172  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

157
158// Create raw tokens for immediate display while highlighting loads
159const createRawTokens = (code: string): TokenizedCode => ({
160 bg: "transparent",
161 fg: "inherit",
162 tokens: code.split("\n").map((line) =>
163 line === ""
164 ? []
165 : [
166 {
167 color: "inherit",
168 content: line,
169 } as ThemedToken,
170 ]
171 ),
172});
173
174// Synchronous highlight with callback for async results
175export const highlightCode = (

Callers 1

CodeBlockContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected