This is my markdown:
`$a<b$` results in $a<b$
`$a< b$` results in $a< b$
The first line can’t render correctly. Because the browser think <b
is the start of a HTML element. This is the html:
<p><code>$a<b$</code> results in $a<b$</p>
<p><code>$a< b$</code> results in $a< b$</p>
According to Less than sign adjacent to letter in version 3 · Issue #2669 · mathjax/MathJax, HTML special characters will be interpreted by the browser long before MathJax (or KaTeX) runs.
My solution is add a space after <
or use \lt
. But I’m worried that I might forget to do that; is there any other way to solve this?