Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chroma: YAML indentation sometimes doubled #10692

Closed
willhaines opened this issue Feb 3, 2023 · 3 comments · Fixed by #10695
Closed

Chroma: YAML indentation sometimes doubled #10692

willhaines opened this issue Feb 3, 2023 · 3 comments · Fixed by #10695

Comments

@willhaines
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168+extended linux/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

yes

Steps to reproduce

  1. Create a yaml code block (or highlight shortcode)
  2. Include a single-line block scalar in your YAML
  3. See that the block scalar content is indented twice as far in the rendered output, compared to the input.

Example

---
title: "Post"
date: 2023-02-02T08:34:04-07:00
draft: false
---

```yaml
one:
  two:
    three: |
      four
    five: |
      six
      seven
```

{{< highlight yaml >}}
one:
  two:
    three: |
      four
    five: |
      six
      seven
{{< /highlight >}}

image

Background

As far as I can tell, the problem is not present upstream in https://github.com/alecthomas/chroma

$ go version -m ~/bin/hugo | grep -i chroma
        dep     github.com/alecthomas/chroma/v2 v2.4.0  h1:Loe2ZjT5x3q1bcWwemqyqEi8p11/IV/ncFCeLYDpWC4=

image

@jmooring
Copy link
Member

jmooring commented Feb 3, 2023

This is a Chroma issue, and it was resolved with alecthomas/chroma@5ca7345. That commit occurred after the release of 2.4.0. We'll get the update when the author rolls another release.

@willhaines
Copy link
Author

Ah, thanks! Sorry for not digging deep enough upstream!

@jmooring jmooring changed the title YAML indentation sometimes doubled Chroma: YAML indentation sometimes doubled Feb 3, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Feb 4, 2023
@bep bep closed this as completed in #10695 Feb 5, 2023
@bep bep closed this as completed in 69c369e Feb 5, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants