Marked has competition.
The first one I learned about ‘Marked’ uses CommonMark and GFM. That’s it.
There are others. Looks like the one called ‘Remark’ is probably the best one. It’s CommonMark-compliant and extensible. Even supports Mermaid with a plugin!
It’s what Astro uses “Remark”, which has extensions for all sorts of Extended Markdown Syntax.