markdown is horrible, horrible format to parse; there are so many ambiguities; CommonMark is so complex because of that and still has so many ambiguities.
it's like YAML: it looks so simple at first, and then the horrors start if you try to use it seriously.
in both cases the most horrors lie in the spaces/tabs/newlines.