CachedMetadata.headings is useful if you don’t care that much about how fresh the information is. But sometimes you need to obtain the most up-to-date state of a file, in which case
CachedMetadata.headings might be slightly outdated because the indexing process is denounced.
To find headings from the up-to-date file contents, you can use CodeMirror’s
syntaxTree but usually it’s just too much, because in markdown headings can be easily located by splitting the text into lines and then looking at the beginning of each line.
That makes sense, thatnks for the explanation.
I wonder why obsidian doesn’t offer the option to parse a specific file to get the same information but up to date