Samsara interview question

How would you implement a Markdown parser?