Markdown's parser seems to be a fascinating anomaly: a specification that consists entirely of exceptions and corner cases.
lol this is a great wording for something I've not been able to express before
I sometimes wonder... is it Markdown's specification chaos the reason for its success? Maybe it was just barely enough spec to be usable but also small enough to allow anyone to make an implementation that seemed right. No qualifications to fail. Thus, it proliferated.
The xkcd[1] problem is a darn shame, though. At least CommonMark exists for people who want to point to a "Standard"
"Markdown" doesn't have a specification, only a syntax description which is ambiguous in many places, and a reference implementation written in perl 22 years ago and totally neglected since.
CommonMark is a comprehensive specification which also has a reference implementation and a test suite.