Skip to content

Language tagged fenced code blocks are not highlighted the same as inside jupyterlab #7

@joelostblom

Description

@joelostblom

Originally reported in jupyter/nbconvert#1385

I noticed that some language tags for fenced code blocks are differentially highlighted in jupyterlab compared to the html output from nbconvert. Would it be possible to use the same stylesheet between jupyterlab and nbconvert to make this consistent (not sure which one is more correct, if any)?

For all the example diff output below, jupyterlab is on the left and nbconvert HTML on the right

  • diff is not highlighted at all
    image

    • For comparison, here is the github highlighting:
    4ac2218 (HEAD -> master) Add sentence
    diff --git a/README.md b/README.md
    index 0647515..8ad6860 100644
    --- a/README.md
    +++ b/README.md
    @@ -1,3 +1,3 @@
     # Correct title

  • sh differs in the highlighting of the command, flags, parentheses, + and -
    image

    • For comparison, here is the github highlighting:
    4ac2218 (HEAD -> master) Add sentence
    diff --git a/README.md b/README.md
    index 0647515..8ad6860 100644
    --- a/README.md
    +++ b/README.md
    @@ -1,3 +1,3 @@
     # Correct title

jupyter core     : 4.6.3
jupyter-notebook : 6.1.4
qtconsole        : not installed
ipython          : 7.18.1
ipykernel        : 5.3.4
jupyter client   : 6.1.7
jupyter lab      : 2.2.6
nbconvert        : 6.0.2  # just installed via conda-forge
ipywidgets       : not installed
nbformat         : 5.0.5
traitlets        : 5.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions