- Home /
How to apply code formatting, in a Numbered/Bulleted list?
I've always had trouble formatting my code, after I use a Numbered/Bulleted
list - It just never formats for some reason. Like:
ONE.
TWO
COPY/PASTE CODE HERE AND FORMAT IT.
Or
Point.
Another point.
public ILogger Logger { get; set; } public LoggingManager(ILogger logger) { Logger = logger; }
Ahhh, in a perfect world where I could format ^
I want it so that, I could put my code, after the number/bullet, like:
N-
CODE HERE
If I do that, I either get out of the list's sync, or it just won't get formatted.
Is this how this thing works in the first place, or I just don't know how? Of course, I didn't see anything about this in the "Unity answers tutorial video"
Thanks.
Answer by Graham-Dunnett · Oct 10, 2013 at 03:46 PM
One
Two
for (int i=0; i < 42; i++)
This uses the backtick character to format the code, it only works for one line.
One
Two
//This is multiple //lines of code //but it's a pita to enter
This uses the code html tag and the br html tag at the end of lines. It requires quite a bit of manual work, since the markdown editor assumes every line you enter whilst in list mode is a new entry in the list. Which means cutting-and-pasting code is non-trivial.
Thanks it works perfectly! - For those who don't know about the code tag (like me) - I actually thought it was [CODE] [/CODE] (like in forums) but it's actually < /code > And the breakline is just (without spaces)
Answer by robertbu · Oct 10, 2013 at 03:51 PM
I too have problems code in relation to lists. That is, if I attempt to format code directly after a list, the formatting does not work correctly. The solution I've found is to put a line of 'normal' text or a dotted line followed by an empty line between the list and the code .
One
Two
Three
#pragma strict function Start() { }
Without the line, the code would not format correctly.
Actually my problem appears to be different. I'm not trying to put code in a numbered list that continues. I'm just trying to paste code directly after a numbered list. The code does not format correctly even with extra lines between the list and the code.
Yes, I also suffered from this, along with what I asked about. But try the code and break tags, should work.
Your answer
Follow this Question
Related Questions
I cant fix format truecolor. it not show.,I cant fix format true color. it not show. 0 Answers
Export objects to a .3DS file at runtime 1 Answer
Editing how bools appear in the Inspector 1 Answer
Texture formats missing.... 0 Answers
exec format error while installing the app on BB Simulator... 1 Answer