# Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

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:

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:

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?

edit retag close merge delete

1

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

( 2020-02-05 23:02:44 +0200 )edit

Sort by » oldest newest most voted

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.

more

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.

( 2020-02-05 20:14:34 +0200 )edit

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

( 2020-02-05 20:20:13 +0200 )edit

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

( 2020-02-05 20:21:23 +0200 )edit

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.

( 2020-02-05 20:24:50 +0200 )edit

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

( 2020-02-05 20:25:48 +0200 )edit

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.

more

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.

more

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.

( 2020-02-05 20:29:29 +0200 )edit

@nbruin Ah yes...

( 2020-02-05 20:54:37 +0200 )edit