# Chroma YAML lexer issue

**URL:** <https://discourse.gohugo.io/t/chroma-yaml-lexer-issue/57545>\
**Category:** support\
**Created:** [September 11, 2026, 5:15pm UTC](https://discourse.gohugo.io/t/chroma-yaml-lexer-issue/57545 "2026-09-11T17:15:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Travis\_Beckham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/travis_beckham/32/22067_2.png) [@Travis\_Beckham](https://discourse.gohugo.io/u/Travis_Beckham)\
**Post date:** [September 11, 2026, 5:15pm UTC](https://discourse.gohugo.io/t/chroma-yaml-lexer-issue/57545/1 "2026-09-11T17:15:03Z")

</div>

In the following syntax highlighted yaml example, trailing punctuation is not colored correctly. This seems to happen with all themes.

![Screenshot 2026-09-11 at 12.12.08 PM](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/f/9/f9711b7e34cd04d8d51f84a6f56eb4f5138098a1.png)

Has anyone run into this before? If so, is there a fix? I’ve tried to format the yaml in different ways with no luck.

```yaml
foo:
  bar: [{ abc: { names: [workerA, workerB] } }]
  baz: [{ xyz: workerC }]

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 11, 2026, 5:36pm UTC](https://discourse.gohugo.io/t/chroma-yaml-lexer-issue/57545/2 "2026-09-11T17:36:29Z")

</div>

This is an [upstream](https://github.com/alecthomas/chroma) bug, reproducible using their [playground](https://swapoff.org/chroma/playground/):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/b/5/b52221a8f9ee4825b57b52cf7237c144af41c3e9.png)

Please create an upstream issue and cross-reference to this topic.

---

<div class="post-metadata">

**Author:** ![Travis\_Beckham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/travis_beckham/32/22067_2.png) [@Travis\_Beckham](https://discourse.gohugo.io/u/Travis_Beckham)\
**Post date:** [September 11, 2026, 6:23pm UTC](https://discourse.gohugo.io/t/chroma-yaml-lexer-issue/57545/3 "2026-09-11T18:23:24Z")

</div>

> **[\[Lexer\] YAML lexer is not coloring trailing punctuation for lists and objects...](https://github.com/alecthomas/chroma/discussions/1379)**
>
> Request type Lexer highlighting bug Language YAML Sample input foo: \[abc, xyz \] bar: \[{ abc: xyz }\] baz: \[{ abc: { names: \[abc, xyz \] } }\] Syntax references Sample of current rendering:
