obsidianmd / obsidian-api

Type definitions for the latest Obsidian API.
https://docs.obsidian.md
MIT License
1.65k stars 192 forks source link

Bug: MarkdownRenderer.render does not add rendered links to metadataCache #144

Closed mayurankv closed 7 months ago

mayurankv commented 7 months ago

I'm not 100% sure if this is a bug or intended behaviour but wanted to be sure!

Steps to reproduce:

lishid commented 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.

mayurankv commented 7 months ago

Ah thank you for clarifying. Is there then a method to modify the metadataCache for a file?

lishid commented 7 months ago

There isn't a direct way - you need to edit the file itself to include the links.