Commonmark.js has a lovely feature that's rare in markdown renderers: it exposes an AST! https://github.com/commonmark/commonmark.js/#usage
This makes it so much easier to extend/modify the syntax in a robust manner.
Related Posts
One cute feature of markdown I'd not noticed before: there's no syntax for images *without* a description (i.e. alt text).

https://spec.commonmark.org/0.31.2/#images
@MekahimeAkari @lifning "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off". -- Real Stroustrup quote, 1986
Counter-intuitively, if you're writing a parser for a programming language, you need it to be a total function. As soon as you build IDE tooling, you need ASTs from invalid or incomplete input.
The parser should return (Ast, List<Error>) rather than Result<Ast, Error>.