Skip to content

Leading whitespace removed in code blocks with syntax highlighting #1021

Open
jupyter/nbconvert
#2203
@rikedyp

Description

Leading whitespaces in codeblocks are removed if syntax highlighting is done. Seemingly regardless of the language used. It is common to want 6 spaces denoting input lines in APL. However, if I use APL syntax highlighting, these spaces are removed. Non-breaking spaces or additional newlines do not help.

Here is a test notebook rendered with nbviewer: https://nbviewer.org/gist/rikedyp/59230d88565c3459d88230b8f2e3c256

And source as a GitHub gist: https://gist.github.com/rikedyp/59230d88565c3459d88230b8f2e3c256

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