Skip to content

Funky spaces in yaml syntax highlighting #33141

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

Closed
DrMaxNix opened this issue Jan 7, 2025 · 2 comments · Fixed by #33136
Closed

Funky spaces in yaml syntax highlighting #33141

DrMaxNix opened this issue Jan 7, 2025 · 2 comments · Fixed by #33136
Labels

Comments

@DrMaxNix
Copy link
Contributor

DrMaxNix commented Jan 7, 2025

Description

For yaml files, the code viewer (yaml files as well as yaml code blocks in markdown) shows spaces at the end of the last line in multi-line values. These are NOT present in the source file, but for some reason they appear in the code viewer.
Sounds funny at first but becomes a hassle pretty quickly if you copy code from the browser window into your project. Now you have a lot of funky spaces that are REALLY there.

Reproduce

  1. In a (fresh) gitea repo, create a file spaces-from-space.yaml with following content:
test: |
  multi
  line
bla: "blub"
  1. Push the file to the repo
  2. In the Gitea UI, navigate to that file and click on the "Raw" button
  3. Now convince yourself one more time that there indeed is no space after the 3rd line
  4. Go back to the file view
  5. Select the 3rd code line with your mouse and see that there are spaces at the end of the line!

More proofs of concept

Also happens with markdown inline yaml: https://git.tjdev.de/DrMaxNix/snippets/src/branch/main/spaces-from-space.md

Gitea Version

v1.22.6

Can you reproduce the bug on the Gitea demo site?

No (registration disabled lol)

Screenshots

How are you running Gitea?

self built binary

@wxiaoguang
Copy link
Contributor

Will fix it

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 8, 2025

It is the chroma (depdendency)'s bug, updating it to latest fixes the problem.

@lunny lunny closed this as completed in 386c1ed Jan 8, 2025
lunny pushed a commit that referenced this issue Jan 8, 2025
…#33133)

And update some dependencies to fix bugs.

Backport  #33129, #33136

Fix #32889
Fix #33141
Fix #33139

---------

Co-authored-by: yp05327 <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants