Skip to content

Markdown: Shell fenced code block have incorrect syntax highlighting after indent #55

@alexr00

Description

@alexr00

I created a sh sample code with some comments inside a fenced code block, place it after an list item and then indent it.
If I indent the code block, the syntax highlighting loses its color.
The bug is in the markdown editor and preview.

Does this issue occur when all extensions are disabled?: YES

Basic Information

  • VS Code Version: 1.77.3 (user setup)
  • OS Version: Windows_NT x64 10.0.19045
  • Color Theme: Dark+ (default dark)

Steps to Reproduce:

  1. Open markdown file
  2. Create list
  3. Add a code block (see sample code below)
  4. See the result (see screenshots below)

Sample Code

1. List One

```sh
sudo apt-get purge --autoremove -y google-chrome-stable

# with alias
remove -y google-chrome-stable
```

1. List Two

    ```sh
    sudo apt-get purge --autoremove -y google-chrome-stable

    # with alias
    remove -y google-chrome-stable
    ```

1. List Three

    ```sh
        sudo apt-get purge --autoremove -y google-chrome-stable

        # with alias
        remove -y google-chrome-stable
    ```

Screenshots

Actual behavior

md-with-error

Expected behavior

md-with-good

Originally from @adorade in microsoft/vscode#180246

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