Markdown kramdown中的嵌套有序列表
根据嵌套无序列表(以及结果)的语法,如下所示Markdown kramdown中的嵌套有序列表,markdown,kramdown,Markdown,Kramdown,根据嵌套无序列表(以及结果)的语法,如下所示 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 有可能实现这样的目标吗 1. 1st item 2. 2nd item 2.1. 1st sub-item of 2nd it
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
有可能实现这样的目标吗
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
注意:我必须使用kramdown,我不能将其更改为支持其他标记解析器。我认为这个问题一开始是错误的,因为它更像是CSS问题而不是kramdown问题。根据问题的答案更改CSS就足够了
ol {
counter-reset: item;
}
ol > li {
counter-increment: item;
}
ol ol > li {
display: block;
}
ol ol > li:before {
content: counters(item, ".") ". ";
margin-left: -20px;
}