Is the only way to display code by manually indenting the lines by 4 spaces?
I use the
3 backticks[code type]
code
3 backticks
way of doing it eg.
```CSS
div {
border: 1px solid #F00;
}
```
for
div {
border: 1px solid #F00;
}
OK easier than manually putting 4 spaces on every line but still not as easy as clicking a button.
I will give it a go next time.
Use this button in the editor:
Just highlight the code and hit it.
It will deal with both inline and block snippets.
I’ll make this my “Did you Know…” for today
I hit the button then started writing the code and it only highlighted the first line so I need to write my code first and then select it and hit the button.
Yep. Unfortunately. I find the backticks a lot easier in that scenario (if you ask me)
Indeed
For myself I have been using a little of Markdown and BBCode. I do like the fact that I can hit those little buttons. Easier to remember. lol
It is confusing
bbcode?
markdown?
GUI?
I wish I knew the definitive “guide”. I usually use “3 backticks” and it works. But if someone knows of a case where it doesn’t work, please speak up.
From what I have seen that is the way that always works. It is the other ways that don’t always work.
I prefer the button, TBH, but I’ve also been in the habit of posting code blocks that I indent as a block on my code editor … meaning that each line is already indented as necessary.
This has been easiest for me:
- write code in sublime
- copy
- add backticks to post
- paste
Manually inserting whitespace is painful.