Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Markdown kramdown中的嵌套有序列表_Markdown_Kramdown - Fatal编程技术网

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;
}