math.stackexchange.com 's design breaks when entering long mathematic formulae

I am currently developing a web app where users should be able to type math formulas using MathJax and LaTeX commands. I have encountered an issue when typing very long commands within a single pair of delimiters to break the design of my application. So I decided to look up how does math.exchange behave in such scenario. I posted an answer to a random question (which I deleted instantly, of course) containing the \frac{a}{b} command within  multiple times and the result I got:

I can scroll horizontally till the end of the equation:

• Can you please reproduce it in the sandbox, so that we can see it live? – Shadow The Curly Braced Wizard May 31 '15 at 13:34
• link here it is, but I can see that others have done similar things already... – Martin Shishkov May 31 '15 at 13:39
• Thanks, reproduced! :) – Shadow The Curly Braced Wizard May 31 '15 at 13:42
• I don't think this is a bug report for SE. All they do is load MathJax script. The script is free to rewrite the whole page in any way, breaking everything in its path. Of course, it tries not to do that... for example, by linebreaking long in-line formulas such as yours. But the line breaks are allowed only in certain places, such as binary relation symbols (I expanded your example to illustrate this). If you give MathJax an insanely long input with no such structure, you get an insane output. – user259867 May 31 '15 at 20:53
• @HomegrownTomato Yes, of course, but shouldn't this be treated somehow? Isn't that a type of an invalid user input? – Martin Shishkov Jun 2 '15 at 6:30
• Please let me know if you've found a workaround for this problem :) – Martin Shishkov Jun 2 '15 at 6:30
• Retagging, as this isn't a bug Stack Exchange can fix... – Oded Jun 9 '15 at 15:17