I’d agree with putting anything like this as an extension, not in the core, because it may conflict with those that want to use mathjax/other math formatting solutions.
But what about adding in dollar signs in the core similar to how pandoc handles it:
Anything between two $ characters will be treated as TeX math. The opening $ must have a character immediately to its right, while the closing $ must have a character immediately to its left. Thus, $20,000 and $30,000 won’t parse as math. If for some reason you need to enclose text in literal $ characters, backslash-escape them and they won’t be treated as math delimiters.
And then have the math itself remain untouched (so that the website/system can format it however they want with mathjax or with something else) but wrapped with a
<span> tag with class
Similarly, two dollar signs (
$$) could be used as block equation/math delimeters (similar to ``` for code blocks and single backticks for inline code), and then be wrapped with a
<div> tag with class
And of course the mathjax itself should be left for websites/systems themselves do deal with; however they want to implement it. (This is the only way since mathjax inherently needs the concept of a browser, a dom, so stmd shouldn’t try to automatically include mathjax on math equations itself, since the output doesn’t make sense by itself.)
This way, it’s easier to clearly mark such text as equations. If that’s too conflicting with regular text (math equations aren’t really a core feature that everyone would use), perhaps it could be an extension too?
Edit: I’m recommending this syntax because it’s already widely used in places where latex code is used and in latex itself, so it makes copy/pasting easier. And in general would mean less friction with everything else, as opposed to simply manually doing
span tags classed as