

Ask HN: How to format code while commenting on HN? - suyash

I've seen some people use code blocks to format text so it's more readable on HN? How do you do that?<p>Thanks.
======
ColinWright
The FAQ is linked at the bottom of the page:

<http://ycombinator.com/newsfaq.html>

In there it says:

What kind of formatting can you use in comments?

<http://news.ycombinator.com/formatdoc>

On that page it says:

    
    
        Blank lines separate paragraphs.
    
        Text after a blank line that is indented by two or
        more spaces is reproduced verbatim. (This is intended
        for code.)
    
        Text surrounded by asterisks is italicized, if the
        character after the first asterisk isn't whitespace.
    
        Urls become links, except in the text field of a
        submission.

------
olefoo
You prefix it with 4 spaces.

    
    
        # like this

