From 813f3d5dd483eb968ddfce310e95844d289d124b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 8 Apr 2022 18:20:05 -0700 Subject: [PATCH] Shared.taskListItemToAscii: handle asciidoctor's characters. Asciidoctor uses different unicode characters for task lists; we should recognize them too and be able to convert them to ascii task lists in formats like gfm. Closes #8011. --- src/Text/Pandoc/Shared.hs | 2 ++ test/command/8011.md | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/command/8011.md diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 95a422287..0956ee03e 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -682,6 +682,8 @@ taskListItemToAscii = handleTaskListItem toMd where toMd (Str "☐" : Space : is) = rawMd "[ ]" : Space : is toMd (Str "☒" : Space : is) = rawMd "[x]" : Space : is + toMd (Str "❏" : Space : is) = rawMd "[ ]" : Space : is + toMd (Str "✓" : Space : is) = rawMd "[x]" : Space : is toMd is = is rawMd = RawInline (Format "markdown") diff --git a/test/command/8011.md b/test/command/8011.md new file mode 100644 index 000000000..0a79ed9e2 --- /dev/null +++ b/test/command/8011.md @@ -0,0 +1,15 @@ +``` +% pandoc -f docbook -t gfm + + +❏ a + + +✓ b + + +^D +- [ ] a + +- [x] b +```