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

Commit and PR diff view does not honour spaces/tabs #13406

Closed
1 of 6 tasks
lynxplay opened this issue Nov 2, 2020 · 5 comments · Fixed by #13415
Closed
1 of 6 tasks

Commit and PR diff view does not honour spaces/tabs #13406

lynxplay opened this issue Nov 2, 2020 · 5 comments · Fixed by #13415
Labels

Comments

@lynxplay
Copy link

lynxplay commented Nov 2, 2020

  • Gitea version (or commit ref): 1.14.0+dev-138-gbcb94ed58
  • Git version: Recreatable on try.gitea.io
  • Operating system: Recreatable on try.gitea.io
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:

Description

Diff view on a commit as well as PRs does not honour spaces or tabs anymore.
The file view itself still does tho.

Recreated here:
The file with spaces and tabs: https://try.gitea.io/lynxplay/testing-gittea/src/branch/master/file-with-spaces.txt
The diff commit view without them: https://try.gitea.io/lynxplay/testing-gittea/commit/4c8fd6c646fe172d0d00d613dd9babfa3cebc965
PR files view: https://try.gitea.io/lynxplay/testing-gittea/pulls/3/files

Screenshots

image
image

@mrsdizzie
Copy link
Member

Broken here: 4617bb6#diff-5d1373f9290f762a4751c497b0e8be279eb04caa3a7cdc2fd3f42b9f505a83beL188-R192

Since we loose mono.wrap > whitespace: pre

@silverwind
Copy link
Member

Argh, LESS strikes again, I didn't notice those additional child selectors when moving the mono class (which did too much in itself).

@zeripath
Copy link
Contributor

zeripath commented Nov 3, 2020

It's worth noting that your changes to the mono class will have improved the appearance of the extended commit messages

@zeripath
Copy link
Contributor

zeripath commented Nov 3, 2020

as I suggested on #maintainers I think if we change box.tmpl et al to use <code class="mono wrap" ... instead of <span ... this should just fix itself.

@silverwind
Copy link
Member

silverwind commented Nov 3, 2020

Yeah, <code> is semantically correct, mono is just for stuff where you want to force monospace font, it's essentially a simple helper and should be in helpers.less. I'll take a look later unless you beat me with a fix.

silverwind added a commit to silverwind/gitea that referenced this issue Nov 3, 2020
- Introduce new .code-inner class that sets the CSS attributes on
rendered code lines like view,blame and diff.
- Rename .wrap class to .word-break to reflect what it actually does
- Remove .raw which was only used on webhook page
- Set white-space: pre-wrap except on blame where it can break the
layout

Fixes: go-gitea#13406
lafriks pushed a commit that referenced this issue Nov 4, 2020
- Introduce new .code-inner class that sets the CSS attributes on
rendered code lines like view,blame and diff.
- Rename .wrap class to .word-break to reflect what it actually does
- Remove .raw which was only used on webhook page
- Set white-space: pre-wrap except on blame where it can break the
layout

Fixes: #13406
@go-gitea go-gitea locked and limited conversation to collaborators Dec 14, 2020
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.

4 participants