Skip to content

Broken Kotlin syntax hightlighting #1171

@SlamaFR

Description

@SlamaFR

Describe the bug

I'm writing code blocks in Java and Kotlin but the Kotlin ones do not render correctly. There no 'Kt' or 'Kotlin' mention in the upper right corner like other languages and the syntax hightlighting is very poor.

Reproduction

Write a code block with Kotlin code :

```kotlin
val notchHead = SkullBuilder()
    .ownerName("notch")
    .build()
```

Look at the produced result

Expected behavior

The code block should mention 'Kotlin' in the upper right corner and the code should be correctly colored.

System Info

❯ npx envinfo --system --npmPackages vitepress --binaries --browsers
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y

  System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 78.88 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.0.0 - /opt/homebrew/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Safari: 15.4
  npmPackages:
    vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4

Additional context

Just to compare, here is a working block using Java syntax

And here is a broken Kotlin one

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions