Have you considered XML. TEI, for example, is very robust and mature for marking up documents.
Yeah this really hurts. If your goal is to precisely mark up a document with some structural elements, XML is strictly superior to Markdown.
The fact that someone would go to all the work to build a model to extract the structure of documents, then choose an output format strictly less expressive than XML, speaks poorly of the state of cross-generational knowledge sharing within the industry.
First I heard of it. https://en.wikipedia.org/wiki/Text_Encoding_Initiative