How to parse a markdown file without having to convert it to HTML?

I want to extract specific sections from markdown files, and I need to convert the texts into objects. Both Snarkdown and Marked seems to translate markdown input to HTML output. If I use them I have to parse it to the DOM again. Not only this requires an extra step, but I may have to use a DOM lib if I’m doing this in the server. Is there a better way to do so?