# MathJax breaks my indentation

Seems like there is a bug, that breaks my indentation.

See

1. In third code section of Create New C++ Class

2. In first code section of Code Generator Generator

3. multiple times in the code section of https://codereview.stackexchange.com/a/84104/ (Perl syntax naturally includes both $ and ). This occurs on both block delimiters and inline delimiters. Live minimal test case:  b0rked   and $
b0rked
\ In the Markdown source, all lines are vertically aligned, not additionally indented • Hmmm... I can reproduce it, and do not understand why it is broken..... – rolfl Feb 15 '15 at 15:07 • Yikes, creepy.... – janos Feb 15 '15 at 15:33 • reproduced on our dev environment, it's mathjax related, happens when we're baking a post's markdown to html, looking into it – m0sa Feb 16 '15 at 15:49 • @m0sa has there been any progress on this problem? I was baffled why my code – even in the editor preview – had this random extra indentation. That kind of sucks for a site that's about clean code, which involves proper formatting. – amon Mar 16 '15 at 8:07 • @amon I looked into it, turned out to be a deep rabbit hole requiring at major refactoring of MarkdownSharp (we'd need to make the pipeline extensible, so we could inject stuff before DoCodeBlocks in RunBlockGamut - currently all the processing happens before we ever hit MarkdownSharp, but we'd need to leverage it's block processing) – m0sa Mar 16 '15 at 11:49 • Similar issue from PPCG. /cc @m0sa – Doorknob Apr 8 '15 at 21:00 ## 1 Answer This seems to happen because of the above line having two  in a row.

static std::string TOKEN_LINEDUMP("$$static std::string TOKEN_INDENTNEXT("$$>");


Removing the second $ on the first line causes it to be shown normal: static std::string TOKEN_LINEDUMP("$
static std::string TOKEN_INDENTNEXT("$$>");  Further investigation is needed. • is this related to mathjax?? – Vogel612 Feb 15 '15 at 15:50 • Actually, removing any of the  will stop the indentation. This does make it look like a MathJax issue. – Jamal Feb 16 '15 at 1:40 • FYI, this is not due to MathJax itself since MathJax stops parsing at HTML elements, so it won't touch <span class="str">"$$&gt;"</span> etc. However, it could have something to do with the way StackExchange's editor isolates LaTeX-input from the Markdown processor. – Peter Krautzberger Feb 17 '15 at 13:25
• Could we not have some <!-- mathjax:off --> magic comment to switch off MathJax on top of a code block? – Mathieu Guindon Oct 17 '15 at 23:22