Hooking into Markdown preview

Has anyone had success hooking into the markdown rendering flow? I’d like to extend Obsidian Markdown with new constructs or at the very least hijack the latex rendering.

The specific feature I have in mind is to use actual LaTeX to render latex math blocks. This would allow researchers to use the range of crazy symbols and packages we use normally in our papers.