• Last edited on Aug 16, 2017, 2:41:39 PM by poke

Embedding code in a single line of plain text

put a backtick character on either side of your code. This only works if your message is one line long.

backtick

Formatting an entire multi-line message as code

Every line of your message must be indented with four spaces.

This can be done manually.

manual indenting

Or it can be done with the “fixed font” button. This button only appears when the text box contains more than one line of code.

fixed font

Or you can use the keyboard shortcut, ctrl-K. Make sure the text box has keyboard focus first.

ctrl-K

Common issues

Trying to use backticks in a multiline message. This does not work. Backticks only work in single line messages.

backtick fail

Indenting only the lines of your message that you intend to be code. This does not work. Every line must be indented; you can’t mix plaintext and code in a multi-line message.

mixed plaintext/code fail

Indenting only the non-empty lines of your message. This does not work. Every line must be indented, including empty lines.

blank line fail

Try it out!

Want to experiment with these techniques, but don’t want to bother users already talking in a programming room? You can use the Sandbox room.