在Markdown中从0开始排序列表 [英] Begin ordered list from 0 in Markdown

查看:303
本文介绍了在Markdown中从0开始排序列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是降价的新手.我在写类似的东西:

I'm new to Markdown. I was writing something like:

#Table of Contents  
0. Item 0  
1. Item 1  
2. Item 2

但这会生成:

  1. 项目0
  2. 第1项
  3. 第2项

是的,我想从零开始列出.有没有简单的方法可以做到这一点?

Yes, I want to start the list from zero. Is there an easy way to do that?

如果没有,我可以简单地重命名所有索引,但是当我有多个项目时,这很烦人.而且我不认为会遇到这个问题,从零开始创建列表对我来说似乎很自然,就像从零开始创建数组的索引一样.

If not, I can simply rename all of my indices, but this is annoying when I have several items. And I didn't think I would got this problem, begin a list from zero looks so natural to me like begin the index of an array from zero.

推荐答案

简单地:

更长:是,但是

当您在Markdown中创建有序列表时,它将被解析为HTML有序列表,即:

When you create ordered list in Markdown it is parsed to HTML ordered list, i.e.:

# Table of Contents

0. Item 0  
1. Item 1  
2. Item 2

将创建:

<h1>Table of Contents</h1>
<ol>
  <li>Item 0</li>
  <li>Item 1</li>
  <li>Item 2</li>
</ol>

因此,如您所见,没有关于起始号码的数据.不幸的是,如果要从某个数字开始,则必须使用纯HTML并编写:

So as you can see, there is no data about starting number. If you want to start at certain number, unfortunately, you have to use pure HTML and write:

<ol start="0">
  <li>Item 0</li>
  <li>Item 1</li>
  <li>Item 2</li>
</ol>

这篇关于在Markdown中从0开始排序列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆