Definitely should be rendered in Preview as syntax-highlighted code. I believe this is what the code-fence indicates, and you def want to retain ability to render as ‘code’ for certain class of use cases.
That said, it would still be nice if “domain-specific markup” like mermaid could be recognized by a plugin and rendered in Preview. (I call it DSM because mermaid seems more like markdown than like, say, python.)
But your question remains, how to indicate that this text should be rendered according to some custom rules?
Since you would still need to somehow demarcate the text that should be considered as custom markup for the plugin to handle, one idea could be to ‘extend’ the code fence grammar to indicate an alt rendering is desired.
For example, something in form:
```language [style]…
where optional token ‘style’ indicates the alternate rendering.
So:
```mermaid graph
would indicate to render the mermaid code as a graph, not as code. (I do notice that adding a second token to the code fence grammar right now doesn’t break it, it seems to ignore it…so might not break other md tools.)