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

Tabs displayed as spaces #14089

Closed
2 of 6 tasks
arthur-trt opened this issue Dec 21, 2020 · 9 comments
Closed
2 of 6 tasks

Tabs displayed as spaces #14089

arthur-trt opened this issue Dec 21, 2020 · 9 comments
Labels

Comments

@arthur-trt
Copy link

  • Gitea version (or commit ref): 1.14.0+dev-425-ge8a354f81
  • Git version: 2.26.2
  • Operating system: Running Docker version 20.10.1, build 831ebea on Ubuntu 20.10 (GNU/Linux 5.8.0-29-generic x86_64)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

For some time now and on the dev and stable channels I have a problem displaying tabs on my repos. Indeed on git when I open the file I see this:

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: LOGIN <MAIL@student.42.fr>  +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/11 18:22:37 by LOGIN #+# #+# */
/* Updated: 2020/11/30 15:11:31 by LOGIN ### ########.fr */
/* */
/* ************************************************************************** */

Whereas if I open it raw I see this:

/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   main.c                                             :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: LOGIN          <MAIL@student.42.fr>          +#+  +:+       +#+      */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/10/11 18:22:37 by LOGIN             #+#    #+#             */
/*   Updated: 2020/11/30 15:11:31 by LOGIN            ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

And there the tabs are well shaped. I tried to reinstall gitea but I can't solve this problem. All my repositories look like this whatever the language (tested with C, BASH, Makefile, and python). I haven't seen anything interesting in the logs about it but if you need more information there's no problem !

Here is the repository link that I used to take these screenshots: https://git.sperec.fr/arthur/cub3d/src/branch/cub3d/src/main.c

Screenshots

Web interface of the repository :
image

View of the raw file in the browser :
image

@zeripath
Copy link
Contributor

This is fixed on try already.

1.14.0+dev-432-g34df4e5df

https://try.gitea.io/arandomer/cub3d/src/branch/cub3d/src/main.c

@arthur-trt
Copy link
Author

arthur-trt commented Dec 21, 2020

I updated to version 1.14.0+dev-433-g09304db9a and the same problem appeared. I tried to migrate the repository from try.gitea and even there I have this tab problem. I tried with freshly installed Firefox, and Brave after deleting cookies and cache.

Here is the name of the migrated repository: https://git.sperec.fr/arthur/cub3d_test/src/branch/cub3d/src/main.c

@zeripath
Copy link
Contributor

zeripath commented Dec 21, 2020

Does https://try.gitea.io/arandomer/cub3d/src/branch/cub3d/src/main.c look correct for you?

I've just tried it on my local firefox 84 (ubuntu package) and chrome and it works.

I've just pulled gitea master to addd424 - rebuilt and it similarly works.

Do you have a local CSS? I agree your site demonstrates the issue.

@arthur-trt
Copy link
Author

It's perfect on try.gitea.io!

I tried on Brave Version 1.18.70 Chromium: 87.0.4280.101 (Official Build) (64-bit) and Firefox 84 fresh install from Ubuntu repositories.

I don't have custom CSS, and the same problem occurs on Windows with Edge, Firefox and Chrome. As well as on Android.

I can share all the necessary logs but I haven't seen anything problematic or interesting.

@zeripath
Copy link
Contributor

Hmm so it looks like it's coming directly out of gitea without the spaces - this is weird.

@mrsdizzie
Copy link
Member

Has something happened to your templates on disk? When looking in a browser all of the HTML from your site is collapsed with no spaces/tabs etc...:

Screen Shot 2020-12-21 at 2 55 14 PM

Vs try and any other test I've tried:

Screen Shot 2020-12-21 at 2 55 40 PM

Or is it possible that whatever proxy you have is messing with the whitespace in the HTML it returns? Does it have the problem if you access Gitea directly without something else in the middle?

@arthur-trt
Copy link
Author

arthur-trt commented Dec 21, 2020

@mrsdizzie You are absolutely right! I use caddy with Cloudflare (I don't know if it plays), and if I go directly through the IP with the port I have no problem. I'll look in that direction, thanks a lot for your help!

EDIT : After testing, by disabling Cloudflare and emptying the cache everything works perfectly. No idea what could have happened, but it's now solved thanks to you! And thank you because I never would have suspected Cloudflare.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

@mrsdizzie You are absolutely right! I use caddy with Cloudflare (I don't know if it plays), and if I go directly through the IP with the port I have no problem. I'll look in that direction, thanks a lot for your help!

EDIT : After testing, by disabling Cloudflare and emptying the cache everything works perfectly. No idea what could have happened, but it's now solved thanks to you! And thank you because I never would have suspected Cloudflare.

you could have started with "Cloudflare" :D
maybe a line should be added to the issue template saying "Are you using Gitea behind CF?"...

@mrsdizzie
Copy link
Member

@arthur-trt It could be that you had HTML minimize turned on:

https://support.cloudflare.com/hc/en-us/articles/200168196-How-do-I-minify-HTML-CSS-and-JavaScript-to-optimize-my-site-

But not familiar with Cloudflare otherwise. Glad it is fixed.

@go-gitea go-gitea locked and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants