Users are reporting a bug where, in posts containing MathJax formulas on the same line as punctuation (like commas or periods), the punctuation sometimes breaks onto a new line—especially in RTL (right-to-left) contexts. verilog15 first described the issue and shared a Hebrew example with MathJax, noting the comma appears on a new line after a formula. codinghorror confirmed the issue is likely MathJax-specific and requested a reproducible example. verilog15 provided a screenshot showing the misplaced comma after $AE=GF$. simon tested the issue in both RTL and LTR layouts and found the problem persists when the window width forces a line break between the formula and punctuation, even in LTR. The issue appears tied to browser (Chrome) rendering of mixed-directional text and MathJax markup, not the language itself. verilog15 clarified that the problem arises specifically when the line wraps between the formula and punctuation, not the directionality of the text. simon confirmed this by resizing the window and observing the break. The consensus is that this is a rendering bug involving MathJax, line wrapping, and punctuation placement in narrow containers.
Hi guys,
I noticed that sometimes if the line in a post has reached some length X and has a comma or period, the comma/period will break to a new line. For example if the long line is
Discourse had a great website.
The output will be:
Discourse has a great webaite
.
This is not quite a good example to reporduce the big but it just shows what’s the but is.
I’ll try to reproduce it here:
Test number 1 - text text texttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt.
Test number 2 - text text texttttttttttttttttttttttttt.
Test number 2 - text text texttttttttttttttttttttttttttttttt.
Edit: it does not happen here. It usually happens when I use mathjax of the same line. If someone wants to see a live example, please PM me
Yes I think you are right. Thanks for the edit.
It looks like meta discourse does not have Mathjax. So if someone wants to see a live example, please PM me, I’ll send him the links (prefer to keep the website private for now).
Thanks again
Our community is RTL so unfortunately I haven’t got to play with LTR so I don’t know if the issue happens in that case.
In the screenshot that I posted the comma should be right after AE=GF. I believe that the comma should be comprssed to the first line or all of “AE=GF,” should be on the next line.
I’m not sure I understand what do you mean. In LTR the comma should be on the right side and in RTL it should be on the left side. Both of the versions look ok becuase the box is wide open. The issue happens when the box breaks (adds new line) between the formula and the comma (try to play with the width of the window and see if its breaks between the formula and the comma).
Thank you for your help