If you use a proper markdown plugin to parse math instead (such as https://github.com/goessner/markdown-it-texmath), then the problems pointed out in this blog post go away.
That is interesting! Have you tried it on the examples in the blog post? I'd be curious to see.