After editing many posts over time, I've come up with my own checklist for formatting posts:
(I'll edit this as more things come to mind)
Code
- Any code must be indented (manually, CTRL+K, or the
{}button in the editor), not formatted with<code>/<pre>. These tags often leave extra whitespace, and if used incorrectly, hides syntax-highlighting. If you're unsure if it's being used, click on "edit" to make sure. - If a long piece of code is surrounded by backticks and wraps to the next line, it is often helpful to remove the backticks and apply indentation so that it can stand on its own line. This is mainly un-ideal if the flow of the sentence can become disrupted by doing this.
- If code appears right after a list (but doesn't belong to the list), then even if the code is indented, it will be rendered incorrectly. Either some important text (no fillers) should be added in between, or
<!--- --->must be added to fix this. - If code inside a list shows up improperly, then it wasn't indented enough. Code within lists must be indented by eight spaces (more spaces required for more nesting).
Blockquotes
- A programming challenge description
- Code not to be reviewed (i.e. code taken as reference)
- A program's input/output
- Pseudocode
Noise (which I remove):
- "Hi"/"hello"/"greetings"...
- "Thanks"/"thanks in advance(d)"/"thx"...
- "Here's my code:" (if it's obvious that it's the OP's code)
- "EDIT:" (unless it's really needed)
Syntax-highlighting
If something is formatted as code which isn't code (i.e. a program's output), then the following should be applied above the text to remove the syntax-highlighting:
<!-- language-all: lang-none -->If a post contains snippets of multiple languages, and the syntax-highlighting is mixed (i.e. JavaScript highlighting being applied to HTML code), then they should be fixed as such (depending on the languages in question):
<!-- language-all: lang-js --> // JavaScript code...<!-- language-all: lang-html --> // HTML code...
Misc.
- Appended improved code (see this)
- Replies to a comment or answer