#1565·carbon

OCaml: The 'match' keyword is not highlighted

Author: chshershCreated Jan 5, 2025Updated Apr 5, 2026
Labelsbug

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

https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/lib/highlight-languages.js#L5

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