It's not marketed as a markdown-to-pdf tool, but I've found that Obsidian (https://obsidian.md) does an excellent job. Just create a new "vault", paste your markdown into a new note, and export to PDF.
I love Obsidian too, however I found that internal links didn't work when exporting it. Do you know what format works? My internal links work in the Obsidian preview but not in the PDF export.
Do you mean internal links within the page, or within your vault? I can't say I've relied on either in a pdf export, but I would expect the former to work and the latter to fail. I suppose links to other notes in your vault could use the obsidian:// protocol but that would be weird to say the least.
How should the internal links work when converting into a PDF? They are obviously intended to enable a wiki-like structure in your notes, but I don't see a ways they could work upon export.