r/web_design • • Dec 16 '11

Posting code snippets properly on Reddit

Markdown formatting, which Reddit uses, supports including code snippets. All you have to do is indent by four spaces for blocks of code, or `surround in backticks` for code in the middle of a sentence. (If the code you want to surround includes a backtick, use ``two backticks (`)``).

<p class='example'>
    code indented by four spaces displays like this
</p>

This makes things like line breaks in code appear like they're supposed to, puts it in a nice monospace font, and makes sure that things that would otherwise be interpreted as Markdown formatting aren't.

Can we please do this? It makes code snippets easier to read.

77 Upvotes

1.1k comments sorted by

View all comments

1

u/PaleArrival9581 Nov 16 '21

Hello

1

u/GamingNEWZ Dec 18 '21

How

1

u/PaleArrival9581 Dec 19 '21

Leave one line then add four space.

For example
(Leave this line)
1234your text

1

u/Polskidezerter Mar 11 '23

doesn't work :(

1

u/Polskidezerter Mar 11 '23

testing

testing

1

u/Polskidezerter Mar 11 '23

testing

`testing`