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.
This commit is contained in:
John MacFarlane 2022-04-08 18:20:05 -07:00
parent 7fb74b74df
commit 813f3d5dd4
2 changed files with 17 additions and 0 deletions

View file

@ -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")

15
test/command/8011.md Normal file
View file

@ -0,0 +1,15 @@
```
% pandoc -f docbook -t gfm
<itemizedlist mark="none">
<listitem>
<simpara>&#10063; a</simpara>
</listitem>
<listitem>
<simpara>&#10003; b</simpara>
</listitem>
</itemizedlist>
^D
- [ ] a
- [x] b
```