# $signs prevent code blocks from ending on MathJax-enabled SE sites It looks like on StackExchange sites that have MathJax enabled, certain placements of $ characters inside code blocks can prevent the code block from ending.

Here's an example post where this has happened. Please see the longest code block: the middle should be text, but it is rendered as code.

I managed to come up with a minimal example. The following markdown,

    $this is code this is text$


renders like this:

$this is code this is text$


(i.e. the middle text line appears as code).

-

## 1 Answer

The improved Markdown/LaTeX separator now handles this case. I've made an edit to the post to force rebuilding the HTML – and remove the sentence noting that something is broken :) – and it now looks as expected.

Your minimal example now works correctly as well.

-
There's another note about the broken rendering at the beginning of the post. I removed that one as well. Thanks! :-) – Szabolcs May 31 '12 at 13:43
There are some problems again with $signs and code blocks. Try this on a MathJax enabled site: pastebin.com/hpBfYs79 The second code line will have extra indentation. Again, this comes up on Mathematica.SE in practice, because Mathematica tends to use$ signs (for example, in this post, if the second, empty, line of the code block is removed.) – Szabolcs Dec 8 '12 at 17:18