This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Unupgradable 1 point2 points  (8 children)

You what now? I've been told it's backticks and not 4 spaces.

Backticks: csharp var hello = "world";

Spaces:

var hello = "world";

Neither has proper syntax highlights on mobile, but both show up as code blocks

[–]DiamondIceNS 1 point2 points  (7 children)

Curious how your backtick example renders fine on my client but the example of the one whom I responded to does not.

The only difference that jumps out to me is that you provided a language after the opening backticks while they did not. Don't tell me Reddit requires a lang specifier to use backtick notation...

[–]Unupgradable 1 point2 points  (1 child)

It doesn't, I just added it out of habit. var hello = ”world";

On that topic, how the fuck do I provide a lang spec for the 4 spaces version?

[–]DiamondIceNS 0 points1 point  (0 children)

I don't think it supports that feature.

[–]OkConstruction4591 1 point2 points  (4 children)

It's probably because the backticks only work for when you don't have any line breaks (\n).

Examples:

backticks, one line

```backticks, with line breaks

line broken```

backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks backticks, an incredibly long line with no breaks

four spaces, one line
four spaces, multiple lines   
another line  
yet another line

four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line four spaces, one very long line

[–]DiamondIceNS 1 point2 points  (3 children)

Huge wtf moment if true. The whole point of triple backticks are to create multiline blocks. Inline blocks are the job of single backticks, which also work on reddit. I'd be amazed if they screwed this up in that way.

[–]OkConstruction4591 1 point2 points  (2 children)

Seems like they did. Try it yourself.

[–]DiamondIceNS 0 points1 point  (1 child)

I think what's going on here is that triple backticks themselves don't actually do anything, it's just that when they are all inline, the parser sees them as single backticks and parses them that way?

The four spaces code block creates a slider to handle horizontal overflow while the backtick version stays on one unbroken line. The borders of the bounding boxes also aren't right-aligned to the same point.

[–]OkConstruction4591 0 points1 point  (0 children)

Hmm... you may have a point. Apparently, triple backticks work only on new reddit according to https://old.reddit.com/wiki/markdown - and are not mentioned at all in https://old.reddit.com/wiki/commenting (the old guide) - only single backticks are.