mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-11 00:30:57 +00:00
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.
7 lines
220 B
TypeScript
7 lines
220 B
TypeScript
const FENCE_RE = /(?:^|\n)\s{0,3}(`{3,}|~{3,})/;
|
|
|
|
/** True when markdown contains a fenced code block that may want Shiki. */
|
|
export function hasMarkdownCodeFence(text: string): boolean {
|
|
return FENCE_RE.test(text);
|
|
}
|