(Re-posting on behalf of @philj56 ; original text below)
The following example shows the issue:
.. math::
|E| + 3
|E|+3
The first line highlights correctly, with the + 3 using normal maths highlighting. On the second line, the lack of whitespace causes the |E| highlighting to never end, and carries on through the whole document until another || pair followed by whitespace is found.
Edit: Actually this doesn't just apply to math mode, the same thing happens without the directive.
(Re-posting on behalf of @philj56 ; original text below)
The following example shows the issue:
.. math:: |E| + 3 |E|+3
The first line highlights correctly, with the + 3 using normal maths highlighting. On the second line, the lack of whitespace causes the |E| highlighting to never end, and carries on through the whole document until another || pair followed by whitespace is found.
Edit: Actually this doesn't just apply to math mode, the same thing happens without the directive.