From f1d83aea12b93b31f5218bed75bd0e9d8d373cb6 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Wed, 2 Jan 2019 20:36:37 +0100 Subject: Implement task lists (#5139) Closes #3051 --- test/command/gfm.md | 29 ++++++++++++ test/command/tasklist.md | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 test/command/tasklist.md (limited to 'test/command') diff --git a/test/command/gfm.md b/test/command/gfm.md index 7a7098989..a4bb088b6 100644 --- a/test/command/gfm.md +++ b/test/command/gfm.md @@ -101,3 +101,32 @@ hi ^D [Para [Str "hi",LineBreak,Str "hi"]] ``` + +``` +% pandoc -f gfm -t native +- [ ] foo +- [x] bar +^D +[BulletList + [[Plain [Str "\9744",Space,Str "foo"]] + ,[Plain [Str "\9746",Space,Str "bar"]]]] +``` + +``` +% pandoc -f gfm-task_lists -t native +- [ ] foo +- [x] bar +^D +[BulletList + [[Plain [Str "[",Space,Str "]",Space,Str "foo"]] + ,[Plain [Str "[x]",Space,Str "bar"]]]] +``` + +``` +% pandoc -f gfm -t gfm +- [ ] foo +- [x] bar +^D + - [ ] foo + - [x] bar +``` 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 + +``` +% pandoc +- [ ] foo +- [x] bar +^D + +``` + + +``` +% pandoc +- [x] foo + - [ ] bar + - [x] baz +- [ ] bim +^D + +``` + + +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 + +

paragraph

+
    +
  1. +ordered unchecked
  2. +
  3. [] plain item
  4. +
  5. +ordered checked
  6. +
+

paragraph

+ +``` + +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 +``` -- cgit v1.2.3