Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TaskList of GitHub Flavored Markdown doesnt support ordered lists

I noticed that there is a way to add tasklist in GFM, as mentioned in their blogpost here, https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments

However it doesnt show any examples for task list for a ordered list. Is it supported? If so, can somebody share an example.

like image 338
viggy Avatar asked Jan 04 '14 19:01

viggy


2 Answers

No, it's not supported. You can write an ordered list of checkboxes like this:

1. [ ] Foo
2. [ ] Bar

It renders as an ordered list in HTML (<ol>), but their stylesheet removes the numbers.

So while you can express the list as an ordered list, you would need your own stylesheet to render it as such.

like image 145
Emil Vikström Avatar answered Sep 30 '22 17:09

Emil Vikström


Note: since the introduction of nested task list (May 2014), numbered task list are still not supported, even though the following would still be rendered with <ol> elements:

1. [ ] Figure out wormholes
  1. [ ] Call @arfon
  2. [ ] Research ([docs](http://en.wikipedia.org/wiki/Wormhole#Time_travel))
  3. [ ] Build prototype #15
  4. [ ] Test run #43 @world-domination/time-travel
2. [ ] ...?
3. [ ] Profit!

And that would give:

https://cloud.githubusercontent.com/assets/182/2975762/9aedfb04-db98-11e3-9946-23e06671061f.png

As in:

<ol class="task-list added">

    <li class="task-list-item">
        <input class="task-list-item-checkbox" type="checkbox" disabled=""></input>
        <label></label>

         Figure out wormholes 

        <ol class="task-list">
            <li class="task-list-item"></li>
            <li class="task-list-item"></li>
            <li class="task-list-item"></li>
            <li class="task-list-item"></li>
        </ol>
    </li>
    <li class="task-list-item"></li>
    <li class="task-list-item"></li>

</ol>
like image 34
VonC Avatar answered Sep 30 '22 17:09

VonC