Files
outline/shared/editor/lib/isCode.ts
T
Hemachandar 50759d40e8 feat: Option to export nested documents (#9679)
* add migration file

* documents.export API

* download dialog

* file ops list item

* export task

* download modal styling

* cleanup

* lint

* Restore individual download actions

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
2026-01-10 21:19:33 -05:00

19 lines
530 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")
);
}