I feel like I may just be using the renderMarkdown
function incorrectly and could use some advice.
for context I’m trying to make a plugin that can grab chunks from other notes and run them though the processing steps to produce the html or plain text resulting from stuff like dataviewjs and jsx plugin codeblocks.
DVJ.data:
# Data
\```dataviewjs
dv.el("b", "BolD");
\```
DVJ.test:
\```dataviewjs
const {data} = meta.sections("_run/DVJ.data");
const text = await data.html;
dv.el("div", text);
\```
in get html: (full code: obsidian-metadata-api-plugin/sections.ts at master · Meep-Tech/obsidian-metadata-api-plugin · GitHub)
await MarkdownRenderer.renderMarkdown(
this._mdPlainText,
this._htmlContainer,
this.root.notePath,
null
);
return this._htmlContainer
I made a tiny test but I can’t get it to work sadly. I can debug into the renderMarkdown
function to see this._mdPlainText
is correct at the time it’s called, but i can’t track why it’s jumping out of execution early or why it’s not rendering correctly despite seeming to go into the dataviewjs processor registered with registerMarkdownCodeBlockProcessor
The resulting this._htmlContainer
element ends up just containing: <span></span>
as a result of the awaited promise.
Am I potentially missing a function to fully await all of the post process renderers? Any advice would be greatly appreciated, Thanks!