https://roshanswain.com/posts/state-machine-md-parser/