Syntax highlighting issue with multiline yaml strings #5872

Closed
opened 2025-11-02 06:39:00 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @silverwind on GitHub (Aug 19, 2020).

https://try.gitea.io/silverwind/symlink-test/src/branch/master/multiline.yaml

Gitea:

image

Chroma Playground:

image

Chroma's highlighting is not ideal for the subsequent lines in the multiline string and the double-character multiline specifiers but I'd expect our rendering to match the Chroma playground but it seems to go haywire starting at the first "|".

cc: @mrsdizzie

Related Chroma Issue: https://github.com/alecthomas/chroma/issues/391

Originally created by @silverwind on GitHub (Aug 19, 2020). https://try.gitea.io/silverwind/symlink-test/src/branch/master/multiline.yaml Gitea: <img width="356" alt="image" src="https://user-images.githubusercontent.com/115237/90615214-164f4480-e20c-11ea-9f3d-f28db9678b91.png"> Chroma Playground: <img width="321" alt="image" src="https://user-images.githubusercontent.com/115237/90615260-27985100-e20c-11ea-8066-dc557b889600.png"> Chroma's highlighting is not ideal for the subsequent lines in the multiline string and the double-character multiline specifiers but I'd expect our rendering to match the Chroma playground but it seems to go haywire starting at the first "|". cc: @mrsdizzie Related Chroma Issue: https://github.com/alecthomas/chroma/issues/391
Author
Owner

@mrsdizzie commented on GitHub (Aug 19, 2020):

Seems like Github renders it the same way based on that linked issue example but I would think ours should be the same as the chroma payground. Looking I believe this commit from 3 months ago probably changes the behavior and I bet the playground code is based on an older release:

https://github.com/alecthomas/chroma/commit/2b9c82d89f09cd86703cb23d02f4e8524b4a5112

This might also be why you didn't see it before as that commit would be in the recent 0.8.0 release we've adopted recently https://github.com/go-gitea/gitea/pull/12337

@mrsdizzie commented on GitHub (Aug 19, 2020): Seems like Github renders it the same way based on that linked issue example but I would think ours should be the same as the chroma payground. Looking I believe this commit from 3 months ago probably changes the behavior and I bet the playground code is based on an older release: https://github.com/alecthomas/chroma/commit/2b9c82d89f09cd86703cb23d02f4e8524b4a5112 This might also be why you didn't see it before as that commit would be in the recent 0.8.0 release we've adopted recently <https://github.com/go-gitea/gitea/pull/12337>
Author
Owner

@silverwind commented on GitHub (Aug 20, 2020):

The chroma playground was updated and now the rendering matches ours, confirming your suspicion so it's purely a Chroma issue. Thanks.

@silverwind commented on GitHub (Aug 20, 2020): The chroma playground was updated and now the rendering matches ours, confirming your suspicion so it's purely a Chroma issue. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5872