Access parsed Markdown

I’m looking into a plugin that would let me copy some Markdown from the current note and transform it into Latex. The current Pandoc route seems set for whole documents more than fragments, and I’d like to write something very simple for pasting into Overleaf, but with a bit of control over how citations are handled.

Is it possible to make use of the existing Markdown parser within Obsidian? Is there a way to get an intermediate tree, or will it always work with a DOM?