Pasting code here is pretty annoying sometimes?

Hello

I don't know if I'm the only one with this problem. But if I want to paste code here, I first need to make sure it's indented with 4 spaces, and the first line is an empty blank newline. Otherwise this forum won't detect it as code.

Would be nice if it'd be possible to just put [code]-brackets around the code, or to be able to select the code here and click on the 'code'-button.
Especially when I want to paste something from the terminal.

Or am I doing something wrong?
For the rest I really like this forum. :slight_smile:

Thanks!

Use triple backticks, which defaults to Rust syntax highlighting in this forum.

```
fn main() {}
```
fn main() {}
1 Like
test

Ohw okay... thanks a lot! lol.
Feel stupid.

It's not really spelled out anywhere but the forum uses CommonMark. If you dig into the spec you'll also find you can set the language by writing it after the three backticks. This forum defaults to Rust, so it's that same as doing:

```Rust
```

But you can also do

```C++

Or many other languages, should you need one other than Rust.

1 Like

Thanks for the reference to CommonMark.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.