mProjectsCode / obsidian-js-engine-plugin

https://www.moritzjung.dev/obsidian-js-engine-plugin-docs/
GNU General Public License v3.0
73 stars 5 forks source link

Codeblock fails when used inside a canvas card #13

Closed Krakor92 closed 4 months ago

Krakor92 commented 5 months ago

When used inside a canvas card, js-engine code blocks fail to render. It seems that the problem lies here

Within a .canvas file, the ctx.sourcePath property sent by the MarkdownCodeBlockProcessor callback is equal to an empty string. Thus, your getExecutionFile returns undefined as expected and the call to getFileCache fails since it expects a TFile