Skip to content

OCaml: The 'match' keyword is not highlighted #1565

@chshersh

Description

@chshersh

First of all, thanks a lot for creating this project! I use it quite often to share code snippets on my X account. And I'm really grateful for you to implementing it and supporting my favourite languages!

Describe the bug

I noticed that the match keyword is not highlighted in OCaml code snippets. See the below example:

To Reproduce
Steps to reproduce the behavior:

  1. Go to carbon.now.sh
  2. Choose OCaml
  3. Type simple code like let example = match 0 with 0 -> 0
  4. See that the match keyword is not highlighted

Expected behavior

match is highlighted as keyword

Screenshots

image

Info (please complete the following information):

Possible culprit

I see that Carbon uses highlight.js here

.map(lang => [lang, require(`highlight.js/lib/languages/${lang}`)])

But looks like highlight.js actually recognieses match as a keyword, so I'm not sure what's happening.

https://github.com/highlightjs/highlight.js/blob/62f8a60a302718b625fa6f81a0aae35cdf824fea/src/languages/ocaml.js#L20

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