Skip to content

[Suggestion] Skip deleted lines from line numbering in code blocks #4751

@that-hatter

Description

@that-hatter

Is your feature request related to a problem? Please describe.

Currently, when enabling line numbers in a code block, lines that are marked as deleted (// [!code --]) are also numbered:

Image

As a result, the line numbers do not accurately reflect what the actual line numbers would be in the code. In the above example, the return line should be line 2 since the console.log line is supposed to be deleted.

Describe the solution you'd like

Deleted lines should not be numbered, or at least, there should be a way/option to skip them.

Describe alternatives you've considered

Alternatively, some way could be added to mark certain lines to skip (e.g., // [!code skip-line-number]).

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions