Add task-list only to parent of task-list-item
There is an issue where the top-level list could be identified as a task-list
when there is a sub-list that is a task list.
For example,
- Item one
- [ ] subitem one
generates the following HTML, where the top list does not have the task-list
class:
<ul>
<li>Item one
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> subitem one</li>
</ul>
</li>
</ul>
However
- Item one
- [ ] subitem one
- Item two
- [ ] subitem two
does place a task-list
class on the top level ul
:
<ul class="task-list">
<li>Item one
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> subitem one</li>
</ul>
</li>
<li>Item two
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> subitem two</li>
</ul>
</li>
</ul>
This can confuse situations where identifying/styling the actual task-list
is important.
This MR changes it so that only the direct parent ul
of a task item is identified as a task-list
, like the first example.
Edited by Brett Walker