Skip to content

wrong highlighting for yaml with comments ending with a colon (:) #2652

Description

@DenisKuplyakov

What to do:

  1. Open demo: https://pygments.org/demo/
  2. Select Language: YAML
  3. Copy-paste the following:
    {
      "foo": "foo",
       # foo:
      "bar": "bar",
       # baz: 0
      "baz": "baz",
       # baz
    }
  4. Choose HTML formatter and lightbulb style.

Observed behavior:
image

Expected behavior:

  1. First comment (foo) should be gray as other comments.
  2. Second comment (baz) should be gray as other comments.
  3. Highlighting of baz key is wrong.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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