mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
33c7c0be00
* feat: add Graphviz rendering for plan mode Support graphviz/dot/gv fenced blocks in the shared viewer and add a Graphviz sample diagram to PLAN_CONTENT for quick validation. * fix: use imperative wheel listener with passive:false in GraphvizBlock
15 lines
519 B
TypeScript
15 lines
519 B
TypeScript
const GRAPHVIZ_LANGUAGES = new Set(['dot', 'graphviz', 'gv']);
|
|
|
|
function getFenceLanguage(language?: string): string | undefined {
|
|
return language?.trim().split(/\s+/, 1)[0]?.toLowerCase();
|
|
}
|
|
|
|
export function isMermaidLanguage(language?: string): boolean {
|
|
return getFenceLanguage(language) === 'mermaid';
|
|
}
|
|
|
|
export function isGraphvizLanguage(language?: string): boolean {
|
|
const normalizedLanguage = getFenceLanguage(language);
|
|
return normalizedLanguage ? GRAPHVIZ_LANGUAGES.has(normalizedLanguage) : false;
|
|
}
|