The callback used by LuaTeX for inserting the penalties and spaces after punctuation should be disabled in math mode, but apparently it isn't.
Workaround until a fix is shipped out:
Of course this won't be necessary if
unicode-math is used.
The problem, as hinted by Barbara Beeton (but not getting the real problem), is that the right arrow happens to occupy the position of exclamation mark in the ASCII code, so LuaTeX blindly applies the penalty and spacing also before it as if it were in text.
The same problem could arise for other math symbols sharing their code point with punctuation symbols.
The characters involved for the OML encoding are
\lhook in the position of
\omega in the position of
- the period in the position of
\star in the position of
- the comma, in the position of
> in the same position as itself.
\omega seem to be affected; more tests with different character combinations should be performed.
In the OMS encoding we have
\Leftrightarrow in the position of
\rightarrow in the position of
\lnot in the position of
\bot in the position of
\emptyset in the position of
\top in the position of
Curiously enough, here
\emptyset are affected.
Here's the output of
used for making the comparison
I'm quite afraid to see what happens with the OMX encoding: I guess that