Search code examples
markdowngithub-flavored-markdown

Nested numbered list with decimal formatting


I have a bulleted list that has a numbered sublist that I can't get to format as I want.

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

On GitHub this renders as:

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

What I'd like is:

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

The following issue didn't seem to help https://github.com/github/markup/issues/210

This is not a duplicate of Markdown: What's the proper way to do a continued list inside of a list? as that is about how to have the numbering continue across higher level list elements.


Solution

  • This isn't really a Markdown issue; Markdown cares about semantics, not presentation. This is about how the generated <ol> is styled.

    GitHub doesn't permit custom styling¹ of their rendered Markup, and that includes setting list-style-type to decimal. You're stuck with the styles they've chosen.


    ¹E.g., see How to add color to Github's README.md file, Which inline html styles does GitHub markdown accept?, and How to retain HTML formatting in GitHub readme file upon upload?.