Unfortunately not the flavor I am using. Or at least it didn't when I got mad enough to switch to restructured text and a more complex build process. Where I've seen a TOC in markdown it was far too much manual effort to maintain the TOC and they tore it out some years back - but maybe better implementations exist today
I fill your pain. For example bitbucket has a total garbage instead of proper markdown renderer. No TOC, no stable header links, no navigation to anchors on first page visit, no image scaling.
But if you control documentation render process there is a number of feature-rich renderers like pandoc, mkdocs and others.