I posted a answer and below some list items the code content turned to other format different from what I was expecting. I tried to indent either by code button or manually but didn't work. Is It a UI bug or do I fail on format rules? In such cases, may I use other marks instead 4-spaces (ex:code tag)?
3 Answers
The problem is the list. When using lists, you need to multiply the indentation by the list level (see this answer's source to understand better):
No list, 4 spaces indents code:
this is code
List item, you now need 8 spaces
this is not code (4 spaces)
this is code (8 spaces)
Sub-list item, you now need 12 spaces:
this is not code (4 spaces)
this is not code (8 spaces)
this is code (12 spaces)
-
1Thanks @terdon and askubuntu support team for the help and correction of the content. I suggest an example like this one in help format page. I believe this case could be a trick for newbie users.– gwarahCommented Jun 12, 2016 at 14:52
-
did you try to format these code contents by the code button {}? @terdon, as I could see, doesn't work for lists. So this interface functionality requires a maintenance or may disable the button in such cases IMHO.– gwarahCommented Jun 15, 2016 at 13:41
-
@gwarah you might be right. I suggest you post a bug report about this. Ask a new question here, tag it with "bug" and explain the issue. That way, the Stack Exchange developers can see it.– terdonCommented Jun 15, 2016 at 14:50
-
This is other issue I wasn't sure. In this question, I wrote in text :" Is It a UI bug or do I fail on format rules?". So I was wondering If this question with a new tag
bug
could suppress the need of a new question.– gwarahCommented Jun 15, 2016 at 16:23 -
@gwarah not really. You would have to explain that the bug is the lack of documentation.– terdonCommented Jun 15, 2016 at 16:25
When your code is inside an ordered or unordered list you will need to indent it 8 spaces to get proper code formatting. I dunno if this is documented anywhere.
Minor note about 2 successive lists of different type even without any indent space.
- ul
1. il <-0 here notice
|<-12 code
break
1. il
- ul <-0 here notice
|<-12 code
ul
il <-0 here notice
|<-12 code
break
il
ul <-0 here notice
|<-12 code
-
1these examples are quite didactic @Sneetsher, thanks. Did you try to do these with code button {} ? You'll see the format won't be as you post. This is the most important part of the question. Since the button doesn't exchange the content as visual code, or it's bugged or it would be disabled in lists to avoid incorrect formats.– gwarahCommented Jun 15, 2016 at 13:31
-
@gwarah, Yeah I crafted that by hand, you are right using buttons it won't let me.– user.dzCommented Jun 17, 2016 at 3:49