From d57c59e9eb464c5e2575eb6e344ae981bf40e5b0 Mon Sep 17 00:00:00 2001 From: Zsolt Viczian Date: Sun, 21 Nov 2021 22:46:37 +0100 Subject: [PATCH] markdown render --- src/ExcalidrawAutomate.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ExcalidrawAutomate.ts b/src/ExcalidrawAutomate.ts index 3435fef..d69f88d 100644 --- a/src/ExcalidrawAutomate.ts +++ b/src/ExcalidrawAutomate.ts @@ -7,6 +7,7 @@ import { FileId, } from "@zsviczian/excalidraw/types/element/types"; import { + MarkdownRenderer, normalizePath, TFile } from "obsidian" @@ -168,6 +169,7 @@ export interface ExcalidrawAutomate { view: ExcalidrawView, //the excalidraw view receiving the drop pointerPosition: {x:number, y:number} //the pointer position on canvas at the time of drop }):boolean; + renderMarkdown(text:string,el:HTMLElement):Promise; } declare let window: any; @@ -771,6 +773,9 @@ export async function initExcalidrawAutomate(plugin: ExcalidrawPlugin):Promise { + await MarkdownRenderer.renderMarkdown(text,el,'',this.plugin); + } }; await initFonts(); return window.ExcalidrawAutomate;