Tabs displayed as spaces #6563

Closed
opened 2025-11-02 06:59:34 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @arthur-trt on GitHub (Dec 21, 2020).

  • 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

Originally created by @arthur-trt on GitHub (Dec 21, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - 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) <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## 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: ```c /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* 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: ```c /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* 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](https://user-images.githubusercontent.com/4441676/102759638-aa751800-4374-11eb-804e-17ac63559a19.png) View of the raw file in the browser : ![image](https://user-images.githubusercontent.com/4441676/102759682-ba8cf780-4374-11eb-8e30-f0805a3fc1a7.png) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 06:59:34 -06:00
Author
Owner

@zeripath commented on GitHub (Dec 21, 2020):

This is fixed on try already.

1.14.0+dev-432-g34df4e5df

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

@zeripath commented on GitHub (Dec 21, 2020): This is fixed on try already. 1.14.0+dev-432-g34df4e5df https://try.gitea.io/arandomer/cub3d/src/branch/cub3d/src/main.c
Author
Owner

@arthur-trt commented on GitHub (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

@arthur-trt commented on GitHub (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
Author
Owner

@zeripath commented on GitHub (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 addd4248da - rebuilt and it similarly works.

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

@zeripath commented on GitHub (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 addd4248daf2f90c5ce54f2d37c268ebab491b4a - rebuilt and it similarly works. Do you have a local CSS? I agree your site demonstrates the issue.
Author
Owner

@arthur-trt commented on GitHub (Dec 21, 2020):

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.

@arthur-trt commented on GitHub (Dec 21, 2020): 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.
Author
Owner

@zeripath commented on GitHub (Dec 21, 2020):

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

@zeripath commented on GitHub (Dec 21, 2020): Hmm so it looks like it's coming directly out of gitea without the spaces - this is weird.
Author
Owner

@mrsdizzie commented on GitHub (Dec 21, 2020):

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?

@mrsdizzie commented on GitHub (Dec 21, 2020): 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...: <img width="1609" alt="Screen Shot 2020-12-21 at 2 55 14 PM" src="https://user-images.githubusercontent.com/1669571/102816825-a4932d00-439c-11eb-9239-1016c429905f.png"> Vs try and any other test I've tried: <img width="1593" alt="Screen Shot 2020-12-21 at 2 55 40 PM" src="https://user-images.githubusercontent.com/1669571/102816859-b1b01c00-439c-11eb-9a4d-0eb77b1901db.png"> 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?
Author
Owner

@arthur-trt commented on GitHub (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.

@arthur-trt commented on GitHub (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.
Author
Owner

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (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.

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

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (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. you could have started with "Cloudflare" :D maybe a line should be added to the issue template saying "Are you using Gitea behind CF?"...
Author
Owner

@mrsdizzie commented on GitHub (Dec 21, 2020):

@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.

@mrsdizzie commented on GitHub (Dec 21, 2020): @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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6563