IMNSHO (In My Not So Humble Opinion) this should be the way to implement any markup outside the commonmark spec - say highlights should be done with <mark class="my-pink-highlight">Hello</mark> and admonitions should be a div with appropriate children and so on.
My reasoning is this: If and when Obsidian stops functioning, you might find it difficult to find a parser to transform obsidian specific markup to an abstract syntax tree and from there to a target format. Parsing with self-written regex is not a forest you want to go deep into.