1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
tests adapted from <https://github.github.com/gfm/#task-list-items-extension->
```
% pandoc
- [ ] foo
- [x] bar
^D
<ul class="task-list">
<li><label><input type="checkbox" />foo</label></li>
<li><label><input type="checkbox" checked="" />bar</label></li>
</ul>
```
```
% pandoc
- [x] foo
- [ ] bar
- [x] baz
- [ ] bim
^D
<ul class="task-list">
<li><label><input type="checkbox" checked="" />foo</label>
<ul class="task-list">
<li><label><input type="checkbox" />bar</label></li>
<li><label><input type="checkbox" checked="" />baz</label></li>
</ul></li>
<li><label><input type="checkbox" />bim</label></li>
</ul>
```
custom html task list test:
```
% pandoc
- [ ] unchecked
- plain item
- [x] checked
paragraph
1. [ ] ordered unchecked
2. [] plain item
3. [x] ordered checked
paragraph
- [ ] list item with a
second paragraph
- [x] checked
^D
<ul>
<li><label><input type="checkbox" />unchecked</label></li>
<li>plain item</li>
<li><label><input type="checkbox" checked="" />checked</label></li>
</ul>
<p>paragraph</p>
<ol type="1">
<li><label><input type="checkbox" />ordered unchecked</label></li>
<li>[] plain item</li>
<li><label><input type="checkbox" checked="" />ordered
checked</label></li>
</ol>
<p>paragraph</p>
<ul class="task-list">
<li><p><label><input type="checkbox" />list item with a</label></p>
<p>second paragraph</p></li>
<li><p><label><input type="checkbox"
checked="" />checked</label></p></li>
</ul>
```
latex task list test:
```
% pandoc -t latex
- [ ] foo bar
baz
- [x] ok
^D
\begin{itemize}
\item[$\square$]
foo bar
baz
\item[$\boxtimes$]
ok
\end{itemize}
```
round trip:
```
% pandoc -f markdown -t markdown
- [ ] foo
- [x] bar
^D
- [ ] foo
- [x] bar
```
|