根据kramdown documentation,嵌套无序列表(以及结果)的语法如下。
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,我无法更改它以支持其他Markdown解析器。
答案 0 :(得分:0)
我认为这个问题一开始是错误的,因为它比CSS是kramdown的更多问题。只需将CSS更改为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;
}