Closed mayurankv closed 7 months ago
MetadataCache is used to cache the parsing of the original file in the vault on disk. MarkdownRenderer.render is used to render some markdown string into a DOM element - the fact that it asks for a sourcePath is so that relative links in the markdown can be resolved properly from the correct perspective.
They are not related to one another.
Ah thank you for clarifying. Is there then a method to modify the metadataCache for a file?
There isn't a direct way - you need to edit the file itself to include the links.
I'm not 100% sure if this is a bug or intended behaviour but wanted to be sure!
Steps to reproduce:
MarkdownRenderer.render(plugin.app, "[[file]]", linkEl, sourcePath, plugin)
does not add the rendered file to themetadataCache
of the file specified by sourcePath.