Files
Netcatty/components/ai-elements/streamdownCodePlugin.ts
T
bincxz b02d52516c fix(ai): load Streamdown without Shiki until a code fence is idle
messageResponse pulled @streamdown/code on first markdown import, so
opening a chat with history paid for the full highlighter even when
the reply was just prose.

Render with CJK only first. When a fence exists and the composer is
idle, lazily import the isolated Shiki plugin.
2026-08-15 03:03:38 +08:00

7 lines
270 B
TypeScript

import { code } from '@streamdown/code';
import { createSafeCodeHighlighter } from './streamdownCodeHighlighter';
/** Isolated Shiki entry — import this file only through warmAiCodeHighlighter. */
export const streamdownCodePlugin = createSafeCodeHighlighter(code);