How to remove markdown interpretation of math symbols without using escape

I followed this tutorial and was able to get mathjax work on my site

However in my case, math symbols such as _ and * are not ignored by Markdown within the $$ delimiters using this config. This is very strange because the tutorial claims it should. Another outdated tutorial talked about using <div> and `` to let markdown treat math expression as verbatim, but that didn’t work for me. The only thing I’ve tried that worked is combining <div> and ``. For example

`<div>
$$\pi$$
</div>`

However, the first ` appears in the rendered text as well and I can’t seem to get rid of it. I have next to zero knowledge about html, so I’m hoping someone can help me find a solution to this. I’m pretty much followed exactly what the tutorial suggested, the only difference is that I called the mathjax.html via footer.html of my theme’s partials directory. Thank you!