The Pandoc Markdown dialect solves many of the mentioned issues. If you want a good editor for that have a look at
https://www.zettlr.com/