mirror of
https://github.com/outline/outline.git
synced 2026-11-28 00:09:58 +03:00
- Add "mermaid" as the primary language identifier for new diagrams - Maintain backward compatibility with existing "mermaidjs" blocks - Create isMermaid() helper function for consistent language checking - Update all Mermaid-related code to support both language variants - Update CSS selectors to style both "mermaid" and "mermaidjs" blocks - Update server-side HTML export to handle both language formats - Add tests to verify backward compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
16 lines
516 B
TypeScript
16 lines
516 B
TypeScript
import type { Node } from "prosemirror-model";
|
|
|
|
export function isCode(node: Node) {
|
|
return node.type.name === "code_block" || node.type.name === "code_fence";
|
|
}
|
|
|
|
/**
|
|
* Returns true if the node is a code block with Mermaid language (supports both "mermaid" and "mermaidjs").
|
|
*
|
|
* @param node The node to check.
|
|
* @returns true if the node is a Mermaid code block.
|
|
*/
|
|
export function isMermaid(node: Node) {
|
|
return isCode(node) && (node.attrs.language === "mermaid" || node.attrs.language === "mermaidjs");
|
|
}
|