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

Code Blocks badly broken #1785

Open
NetScr1be opened this issue Feb 23, 2024 · 1 comment
Open

Code Blocks badly broken #1785

NetScr1be opened this issue Feb 23, 2024 · 1 comment

Comments

@NetScr1be
Copy link

NetScr1be commented Feb 23, 2024

I get we need to be careful about how we write Github markdown and respect the standard.

We can't expect to dump a bunch of crufty crap in a file and expect it to render properly but this is a bit much.

Code blocks don't work (especially when combined with bullets and/or tasks) unless everything is perfectly vertically aligned AND there are no trailing spaces.

I've read the other issues on this topic which is how I know about the alignment peculiarity but I found the trailing spaces thing on my own.

This is beyond finicky. The [*Writing Code Blocks* reference](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks) makes no mention of either alignment or trailing spaces.

I've been over this text ten times at least (see image below) re-aligning this and remove all the stray space characters and have been able to make some progress but the rendering engine loses its way towards bottom of the file and kind of gives up.

URL: NetScr1be/XRPLLabs.Bluesky#1

I'd be happy to attach a copy of the file for review if the [documentation on attachments[(https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files) agreed with what we are seeing here.

I too work for a software company and have written ~150 help articles and am the editor for what others write (in Gitbook BTW). I'm not some lost lost markdown newbie.

Can we please get some attention on what (according to the issues in this repo) is a long-standing issue?

Just really looking for some consistency so we can at least find our own way through it.

@NetScr1be
Copy link
Author

BTW, I was ***finally*** able to get the text to render properly after I found the blank line with four spaces in it in the middle of the code block.

Back in the day, (been in computers for 40 years now) four spaces was a tab.

The original markdown syntax hijacked the four-space tab for code blocks  and subsequently included fenced code blocks in the [*Extended Syntax*](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks).

The [*Basic Syntax* for Markdown code blocks](https://www.markdownguide.org/basic-syntax/#code) specifies;

> indent ***every line*** of the block by at least four spaces or one tab.

There is also a note that indents can be avoided by using fenced code blocks

Re-reviewing the docs on Github Markdown Code Blocks finds the only mention of spaces to be;

> Tip: To preserve your formatting within a list, make sure to indent non-fenced code blocks by eight spaces.

This is weird because this is the only mention of ***non-fenced*** code blocks.

The rendering engine seems to be indent and/or fencing promiscuous in that it accepts any combination of indents, fencing and who knows what else.

Please pick a lane.

If there are fences then indents are for formating only - i.e. they ***DO NOT*** denote the beginning/end of a code block.

There is no reason to assign any kind of meaning to a few spaces on an otherwise blank line in a fenced-in area.

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

No branches or pull requests

1 participant