Is there a way to get the content of a section?

My goal is to identify whether a dataview field is inside a section or not. I can read the content with:

await app.vault.cachedRead(app.vault.getAbstractFileByPath(("path/to/note.md")))

And then use a markdown parser to read it. But I wonder if it has been saved somewhere in the cache?

My current idea is to parse the markdown file to json. There are markdown-it and mdast. What is your pick?