mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
50759d40e8
* 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>
19 lines
530 B
TypeScript
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")
|
|
);
|
|
}
|