JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.78k stars 409 forks source link

Displaying markdown code blocks routinely drops trailing parenthesis #1111

Closed goerz closed 5 months ago

goerz commented 5 months ago

Displaying markdown code blocks in a Jupyter notebook often chops off trailing parenthesis.

For example:

using Markdown: Markdown, MD

md = MD(Markdown.Code("julia", "gate_concurrence(U) = gate_concurrence(weyl_chamber_coordinates(U)...)"))

will print

gate_concurrence(U) = gate_concurrence(weyl_chamber_coordinates(U)...

Notice that there is a parenthesis missing at the end.

For more details, see the notebook at https://gist.github.com/goerz/bb2f1589d2aa523ffa8ccd4d0addcd86

It is not clear to me whether this is a bug in IJulia or a bug in Jupyter. Please advise if I should report this elsewhere.

If you're submitting a bug report, be sure to include as much relevant information as possible, including:

  1. The output of versioninfo()
  2. How you installed Julia

Julia was installed via juliaup, running on macOS. Jupyter was installed through CondaForge (completely independent of Julia installation). Running JupyterLab 4.0.8.

Output of versioninfo() is

Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_NUM_THREADS = auto
goerz commented 5 months ago

Also reported as https://github.com/jupyterlab/jupyterlab/issues/16112

goerz commented 5 months ago

For more details, see the notebook at https://gist.github.com/goerz/bb2f1589d2aa523ffa8ccd4d0addcd86

Huh, it seems like this issue does appear in the renderer used by Github, or NBViewer! Thus, I suppose this has to be an issue in the frontend, which most likely puts the problem with JupyterLab.

Here is a screenshot from JupyterLab running on my laptop, showing the problem:

CleanShot 2024-04-04 at 17 28 54@2x

goerz commented 5 months ago

Closing: this is a regression bug in JupyterLab 4 and (presumably) has nothing to do with IJulia. See https://github.com/jupyterlab/jupyterlab/issues/16112#issuecomment-2040202223