【问题标题】:Nested numbered list with decimal formatting具有十进制格式的嵌套编号列表
【发布时间】:2019-09-15 02:25:30
【问题描述】:

我有一个项目符号列表,其中有一个编号的子列表,我无法按照我的意愿进行格式化。

- foo
- bar
   1. some
   1. thing
   1. else
- baz

在 GitHub 上呈现为:

 - foo
 - bar
     i. some
    ii. thing
   iii. else
 - baz

我想要的是:

 - foo
 - bar
     1. some
     2. thing
     3. else
 - baz

以下问题似乎没有帮助https://github.com/github/markup/issues/210

这不是 Markdown: What's the proper way to do a continued list inside of a list? 的重复,因为这是关于如何在更高级别的列表元素中继续编号。

【问题讨论】:

  • 看来你不能。另见stackoverflow.com/questions/54101316/…
  • 这个问题看起来是关于让数字在更高级别的列表项中继续存在。我只是希望它使用第一级编号列表作为编号列表

标签: markdown github-flavored-markdown


【解决方案1】:

这不是一个真正的 Markdown 问题; Markdown 关心语义,而不是表示。这是关于生成的<ol> 的样式。

GitHub 不允许对其呈现的标记进行自定义样式¹,这包括将 list-style-type 设置为 decimal。你被他们选择的风格所困扰。


¹例如,请参阅 How to add color to Github's README.md fileWhich inline html styles does GitHub markdown accept?How to retain HTML formatting in GitHub readme file upon upload?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多