• Last edited on Apr 11, 2019, 5:15:08 PM by Kevin

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.

Click for examplebacktick

Formatting an entire multi-line message as code

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

You can use the keyboard shortcut, ctrl-k. Make sure the text box has keyboard focus first.

Click for examplectrl-k

Or you can use the “fixed font” button. This button only appears when the text box contains more than one line of code.

Click for examplefixed font

Or you can add the spaces manually.

Click for examplemanual indenting

Common issues

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

Click for examplebacktick 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.

Click for examplemixed plaintext/code fail

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

Click for exampleblank 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.