how to format code in a forum question

Just trying to make a JSON block (or any other code) look nice in this post.


For example, here's some JSON (used in another question).


{"applinks":{"apps":[], "details":[{"appID":"ABCDEFG.com.mycompany.myapp","paths":["/path1/"]}]}}


How do I make this look nice so that the JSON is pretty-printed?

Answered by guywithmazda in 163002022

Use the <> button in the toolbar at the top of the post editor to insert a code block. Paste in code, or just type in what you want. It uses a a fixed-width font so code indentations line up better.

Accepted Answer

Use the <> button in the toolbar at the top of the post editor to insert a code block. Paste in code, or just type in what you want. It uses a a fixed-width font so code indentations line up better.

{"applinks":
     {
"apps":[], "details":
[{"appID":"ABCDEFG.com.mycompany.myapp","paths":["/path1/"]}]    
     }
}

I was hoping it would actually do the pretty-printing, too. Thanks for the tip, though. it's helpful.

how to format code in a forum question
 
 
Q