(code: string)
| 157 | |
| 158 | // Create raw tokens for immediate display while highlighting loads |
| 159 | const 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 |
| 175 | export const highlightCode = ( |