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

Update context-functions.md: remove redundant indentation in code blocks #18575

Open
wants to merge 1 commit into
base: language-reference-stable
Choose a base branch
from

Conversation

unkarjedy
Copy link
Contributor

There might be a more general issue with the .md files rendered used on the site.
It incorrectly handles indentation.
It removes indentation from the first line, but leaves remaining lines untouched.
IMO it shouldn't affect indentation at all, and all existing code blocks should be reviewed and the indentation should be removed.

Example of bad rendering:
image
image
image

@dwijnand
Copy link
Member

@Florian3k can you see if we can address the root cause? We shouldn't remove the indentation on the first line.

@Florian3k
Copy link
Contributor

Florian3k commented Sep 25, 2023

Yes, that's definitely something to fix (created #18593 for this).

Another issue is that we have different indentation in code blocks throughout the documentation (sometimes none, sometimes whole snippet is indented by 2 spaces). Do we want to unify this, and if so which way?

@unkarjedy
Copy link
Contributor Author

IMO it shouldn't affect indentation at all, and all existing code blocks should be reviewed and the indentation should be removed.
Florian3k can you see if we can address the root cause? We shouldn't remove the indentation on the first line.

And if it's fixed, ideally all pages should be reviewed for code examples with common indentation.
I noticed that one ^ by accident.
Some regexp-search for the first line could be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants