mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
18 lines
620 B
TypeScript
18 lines
620 B
TypeScript
import { ExcalidrawElement, ExcalidrawImageElement } from "@zsviczian/excalidraw/types/excalidraw/element/types";
|
|
import { requireApiVersion } from "obsidian";
|
|
|
|
export function getMermaidImageElements (elements: ExcalidrawElement[]):ExcalidrawImageElement[] {
|
|
return elements
|
|
? elements.filter((element) =>
|
|
element.type === "image" && element.customData?.mermaidText
|
|
) as ExcalidrawImageElement[]
|
|
: [];
|
|
}
|
|
|
|
export function getMermaidText (element: ExcalidrawElement):string {
|
|
return element.customData?.mermaidText;
|
|
}
|
|
|
|
export function shouldRenderMermaid():boolean {
|
|
return requireApiVersion("1.4.14");
|
|
} |