# Mathjax on the same line causes period breaks to a new line

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

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

1 Like

This is 100% going to be mathjax specific so I have edited your title to reflect that.

You should show us a repro with the mathjax please.

1 Like

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

2 Likes

Can’t you post the mathjax here in a code block? I don’t understand why that can’t be shared?

2 Likes

The line:

ב. שים לב שהמרובע $ABGE$ הוא מקבילית ולכן מתקיים $AE=BG$, נתון ש- $AE=GF$, טרנזיטיבית מתקבל $BG=GF$ ולכן $\triangle GBF$ הוא משולש שווה שוקיים.

Image:

Thanks again

3 Likes

Do you know if the issue is only happening when your locale is set to a RTL language?

In the screenshot that you posted, where should the period be appearing?

1 Like

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.

When I add that text to a LTR site, I’m seeing the following:

ב. שים לב שהמרובע $ABGE$ הוא מקבילית ולכן מתקיים $AE=BG$, נתון ש- $AE=GF$, טרנזיטיבית מתקבל $BG=GF$ ולכן $\triangle GBF$ הוא משולש שווה שוקיים.

When I replace the Hebrew with English and leave in some random punctuation, I get:

This is, $ABGE$ a test. $AE=BG$, This is only a test. $AE=GF$, this is only a test. lets see what happens $\triangle GBF$ test.

The English version seems correct to me. The Hebrew version seems to be wrong.

2 Likes

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).