* Apply syntax highlighting to content based on block type using Shiki. * Only applies highlighting when color output is enabled.
(content: string, type: DeepnoteBlock['type'])
| 280 | * Only applies highlighting when color output is enabled. |
| 281 | */ |
| 282 | async function highlightContent(content: string, type: DeepnoteBlock['type']): Promise<string> { |
| 283 | const { color } = getOutputConfig() |
| 284 | |
| 285 | if (color) { |
| 286 | if (type === 'code') { |
| 287 | return codeToANSI(content, 'python', 'catppuccin-macchiato') |
| 288 | } |
| 289 | if (type === 'sql') { |
| 290 | return codeToANSI(content, 'sql', 'catppuccin-macchiato') |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | return content |
| 295 | } |
no test coverage detected