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

Indentation doesn't work properly #16

Closed
jbonadiman opened this issue Apr 25, 2023 · 5 comments
Closed

Indentation doesn't work properly #16

jbonadiman opened this issue Apr 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@jbonadiman
Copy link

I don't know if this is related with only one file format or more, I just started using the app (awesome job, btw! 🥰).
When I visualize my shell script, it shows up like this:

image
(I'm using the ".sh" extension and my indentation is set to 2 spaces. I even tried to update this information but it didn't "save" - I'll open another issue for that later)

But my file is actually formatted like this:
image

I tried to manually set indentation from 2 to 4 spaces, but it didn't change anything in the visualization.

@thomiceli
Copy link
Owner

Hi and thank you!

Currently it behaves like Github Gist and a bit like Vim : when you press tab it indents with the current settings (size and type).
Only the tabs size change dynamically when you change the settings, that's pretty fair for me (atm) because it could be tricky to convert space and tabs.

That said the problem might come from somewhere else since your indentation in the first screen seems to be only one space ..?

@jbonadiman
Copy link
Author

Yeah, I realized later that that option sets the tabs size during editting, which makes sense.
But the visualization still looks a bit off. I used 4 spaces in the entire file, but specially inner indents look like got 1 space. And when I edit the file I see the 4 spaces again, so the information is still there.

I really liked your project and I'd love to contribute, so I tried looking into the frontend to see if I spot the error but I don't get shit about it. I'll try to help with the backend instead 😅

@thomiceli
Copy link
Owner

Are you using Opengist through a proxy or something that "optimize" html by removing spaces ? Also what browser are you using ? Seems to be front-related

@jbonadiman
Copy link
Author

jbonadiman commented Apr 26, 2023

Are you using Opengist through a proxy or something that "optimize" html by removing spaces ? Also what browser are you using ? Seems to be front-related

Those are very good questions and I'm not sure about that... I'm using Firefox (112.0.1) and I'm proxying using nginx with the following config:

server {
    listen                 443 ssl;
    server_name            <domain>;

    client_max_body_size   10M;

    ssl_certificate <path>;
    ssl_certificate_key <path>;

    location / {
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;

        proxy_pass              https://localhost:6157/;

        proxy_read_timeout      600s;
        proxy_send_timeout      600s;
    }
}

@thomiceli thomiceli added the bug Something isn't working label Apr 27, 2023
@Maronato
Copy link
Contributor

Maronato commented Sep 5, 2023

In case someone else comes here with the same issue, @thomiceli's idea was spot on and I was able to fix it by disabling Cloudflare's HTML auto minify:

Screenshot 2023-09-04 at 22 25 33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants