-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Highlighted diff emitting extraneous newlines #12172
Comments
mrsdizzie
added a commit
to mrsdizzie/gitea
that referenced
this issue
Jul 7, 2020
Somewhere when tokenizing a newline gets added to code formatted by chroma. This breaks the case of 'added-code' inside of an 'added-line' in a diff. Just remove any newline when processing chunks of code since we don't need it. Fixes go-gitea#12172
Hmm weird it does seem to be happening somewhere in Chroma in the tokenizing stage. Put up a PR to just remove the added newline |
lafriks
pushed a commit
that referenced
this issue
Jul 7, 2020
* Remove newline when highlighting random chunks of code Somewhere when tokenizing a newline gets added to code formatted by chroma. This breaks the case of 'added-code' inside of an 'added-line' in a diff. Just remove any newline when processing chunks of code since we don't need it. Fixes #12172 * don't process empty lines * This is the proper way to fix this by telling chroma not to add the newline in the first place
ydelafollye
pushed a commit
to ydelafollye/gitea
that referenced
this issue
Jul 31, 2020
* Remove newline when highlighting random chunks of code Somewhere when tokenizing a newline gets added to code formatted by chroma. This breaks the case of 'added-code' inside of an 'added-line' in a diff. Just remove any newline when processing chunks of code since we don't need it. Fixes go-gitea#12172 * don't process empty lines * This is the proper way to fix this by telling chroma not to add the newline in the first place
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Example: https://try.gitea.io/silverwind/updates/commit/03967f99a6cbb87c7ea7385d264ed42539b0162f
#12047 seems to cause text in diffs to sometimes split up a single line:
It should be
I think the issue is that either we or chroma are emitting newlines where there shouldn't be ones. Here's the raw HTML of line 2 line with three newlines present on a single actual line:
cc: @mrsdizzie
The text was updated successfully, but these errors were encountered: