I found a lot of Markdown Parsers that convert a markdown String into HTML.
However what I want is to analyse the contents syntactically and semantically. In Java for JSON String Analysis there is JSONObject. I'm looking for something like this for Typescript to analyse Markdown Files.
const markdownString = `
# Heading 1
Text
## Heading 2
More Text
`
const markdownObject = new MarkdownObject(markdownString);
// heading2= 'Heading 2'
const heading2 = markdownObject.getSection('Heading 1').getSection('Heading 2').getTitle();
// text= 'MoreText'
const text = markdownObject.getSection('Heading 1').getSection('Heading 2').getTextContent();