aboutsummaryrefslogtreecommitdiff
path: root/test/command/tasklist.md
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2019-01-02 20:36:37 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-02 11:36:37 -0800
commitf1d83aea12b93b31f5218bed75bd0e9d8d373cb6 (patch)
treeee6606c10b3790213c553f9fe6b5ea519f1a8dce /test/command/tasklist.md
parent9097ec41a9c333f24fec63085806da392f8108d4 (diff)
downloadpandoc-f1d83aea12b93b31f5218bed75bd0e9d8d373cb6.tar.gz
Implement task lists (#5139)
Closes #3051
Diffstat (limited to 'test/command/tasklist.md')
-rw-r--r--test/command/tasklist.md113
1 files changed, 113 insertions, 0 deletions
diff --git a/test/command/tasklist.md b/test/command/tasklist.md
new file mode 100644
index 000000000..5ff628e1c
--- /dev/null
+++ b/test/command/tasklist.md
@@ -0,0 +1,113 @@
+tests adapted from <https://github.github.com/gfm/#task-list-items-extension->
+
+```
+% pandoc
+- [ ] foo
+- [x] bar
+^D
+<ul>
+<li><input type="checkbox" disabled="" />
+foo</li>
+<li><input type="checkbox" disabled="" checked="" />
+bar</li>
+</ul>
+```
+
+
+```
+% pandoc
+- [x] foo
+ - [ ] bar
+ - [x] baz
+- [ ] bim
+^D
+<ul>
+<li><input type="checkbox" disabled="" checked="" />
+foo<ul>
+<li><input type="checkbox" disabled="" />
+bar</li>
+<li><input type="checkbox" disabled="" checked="" />
+baz</li>
+</ul></li>
+<li><input type="checkbox" disabled="" />
+bim</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><input type="checkbox" disabled="" />
+unchecked</li>
+<li>plain item</li>
+<li><input type="checkbox" disabled="" checked="" />
+checked</li>
+</ul>
+<p>paragraph</p>
+<ol type="1">
+<li><input type="checkbox" disabled="" />
+ordered unchecked</li>
+<li>[] plain item</li>
+<li><input type="checkbox" disabled="" checked="" />
+ordered checked</li>
+</ol>
+<p>paragraph</p>
+<ul>
+<li><p><input type="checkbox" disabled="" />
+list item with a</p><p>second paragraph</p></li>
+<li><p><input type="checkbox" disabled="" checked="" />
+checked</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
+```