0

Accordly to kramdown documentation the syntax for nested unordered lists (and also the result) is the following.

1. 1st item
2. 2nd item
   1. 1st sub-item of 2nd item
   2. 2nd sub-item of 2nd item
3. 3rd item
   1. 1st sub-item of 3rd item
   2. 2nd sub-item of 3rd item

Is it possible to achieve something like this instead?

1. 1st item
2. 2nd item
   2.1. 1st sub-item of 2nd item
   2.2. 2nd sub-item of 2nd item
3. 3rd item
   3.1. 1st sub-item of 3rd item
   3.2. 2nd sub-item of 3rd item

Note: I have to use kramdown, I cannot change it in favor of other markdown parsers.

gvgramazio
  • 1,115
  • 3
  • 13
  • 30

1 Answers1

1

I think that the question was wrong in the beginning since it is more a problem of CSS than kramdown. It was enough to change the CSS accordly to the answers to this question.

ol {
    counter-reset: item;
}

ol > li {
    counter-increment: item;
}

ol ol > li {
    display: block;
}

ol ol > li:before {
    content: counters(item, ".") ". ";
    margin-left: -20px;
}
gvgramazio
  • 1,115
  • 3
  • 13
  • 30