Ask Your Question
2

Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

asked 5 years ago

holistone gravatar image

updated 5 years ago

I have recently installed the latest Sagemath 9.0 on a Windows 10 machine and noticed a Markdown bold formatting problem that is not present on the Cocalc.com Sagemath 9.0 version. Here is the Markdown:

For each of the 10 questions a student can choose 1 of **3** possibilities: (1) answer T, (2) answer F, or (3) omit. By the **Extended Rule of Products**, there are $3^{10}$ ways of accomplishing this, this is far more than $2^{10}$.

On the local 9.0 install it renders as:

image description

Notice that the bold is not terminated by the ** after the '3'. On the other hand, the same code on Cocalc.com renders correctly with Sagemath 9.0:

image description

Both of these use the latest Chrome browser. Is there any way to correct the Markdown rendering on the local install?

If Sagemath provides the Jupyter notebook for CoCalc is it possible for them to provide the SAME Jupyter notebook with their binary downloads for windows and other platforms? Or just update the Jupyter notebook part of the Sagemath 9.0 Windows executable?

Preview: (hide)

Comments

1

As a workaround, use an HTML tag, i.e., write <strong>3</strong> instead of **3**.

Juanjo gravatar imageJuanjo ( 5 years ago )

3 Answers

Sort by » oldest newest most voted
1

answered 5 years ago

rburing gravatar image

updated 5 years ago

This is a bug in Jupyter: #4259 Markdown broken for single-character bold and italics. Hopefully it will be fixed there (although it doesn't seem to be a priority), so eventually the fix will be in SageMath as well.

For now, a workaround is to write 'three' instead of '3' :)

Another idea is to try JupyterLab, where the respective issue is fixed.

Preview: (hide)
link

Comments

If that's the case, how does it work in the Cocalc.com Sagemath 9.0 version?

Also, if a "single-character bug" I would have expected the bold to terminated by the *'s at the start of "Extended" rather that at the *'s at the end.

holistone gravatar imageholistone ( 5 years ago )

@rburing: I posted my answer without seeing yours...

eric_g gravatar imageeric_g ( 5 years ago )

@holistone: CoCalc uses a customized version of Jupyter, which may explain why the bug does not show up there.

eric_g gravatar imageeric_g ( 5 years ago )

On cocalc.com if you go to Help → About, it reads:

CoCalc Jupyter notebook is a complete open source rewrite by SageMath, Inc. of the classical Jupyter notebook client from the Jupyter project.

So they are not the same.

rburing gravatar imagerburing ( 5 years ago )

@eric_g conversely, I posted my comment without seeing yours :)

rburing gravatar imagerburing ( 5 years ago )
0

answered 5 years ago

nbruin gravatar image

It looks like this is a problem in the markdown processor for the standard Jupyter notebook server (so for sage, it's an upstream bug). The jupyter notebook server in cocalc is a custom one. The problem seems to be that the markdown for a single bold character doesn't get processed right if there are further bold markers: in **a** and **b** the "middle" if there's another such string. The same thing seems to happen with italics, so *a* and *b* and *c* and *d* and *e* gets misrendered as (italics) a* and *b (roman) and (italics) c* and *d (roman) and (italics) e. This should definitely be reported (to jupyter). In the mean time, the workaround would be to avoid bolding single characters ... In this case, you can just spell it out as **three**, which is recommended english style anyway.

Preview: (hide)
link
0

answered 5 years ago

eric_g gravatar image

I confirm the bug with SageMath 9.0 and 9.1.beta1, running on Ubuntu 18.04 with Firefox browser.

As a workaround, you can use the alternative Markdown notation for bold characters, namely double underscores: replacing **3** by __3__ works.

Preview: (hide)
link

Comments

That only works if you have only one single character that needs to be bolded/italicized, because then you can use a unique pair of delimiters. in __a__ and **b** and __c__ and **d** you run into the same problem again.

nbruin gravatar imagenbruin ( 5 years ago )

@nbruin Ah yes...

eric_g gravatar imageeric_g ( 5 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 563 times

Last updated: Feb 06 '20