aboutsummaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorSeth Speaks <[email protected]>2023-09-16 09:21:01 -0700
committerGitHub <[email protected]>2023-09-16 09:21:01 -0700
commit0d27947b96f7066edeed8a63c196e045ac8822b5 (patch)
treed417142aff52056479e96335dc512f8d351eb846 /test/command
parent138613156a53f73065223651fd77cef60fdb8e82 (diff)
HTML reader: parse task lists using input elements (#9066)
Allow the HTML reader to parse task lists of the sort produced by pandoc. Closes #9047
Diffstat (limited to 'test/command')
-rw-r--r--test/command/9047.md47
-rw-r--r--test/command/tasklist.md2
2 files changed, 48 insertions, 1 deletions
diff --git a/test/command/9047.md b/test/command/9047.md
new file mode 100644
index 000000000..84c405e07
--- /dev/null
+++ b/test/command/9047.md
@@ -0,0 +1,47 @@
+tests meant to test the fixes of bug [#9047](https://github.com/jgm/pandoc/issues/9047)
+
+```
+% pandoc -f html -t html
+<ul class="task-list">
+<li><label><input type="checkbox" />foo</label></li>
+<li><label><input type="checkbox" checked="" />bar</label></li>
+<li><label><input type="button" checked="" />foobar</label></li>
+<li><input id="hello" type="checkbox" checked/><label for="hello">hello</label></li>
+</ul>
+^D
+<ul>
+<li><label><input type="checkbox" />foo</label></li>
+<li><label><input type="checkbox" checked="" />bar</label></li>
+<li>foobar</li>
+<li><label><input type="checkbox" checked="" />hello</label></li>
+</ul>
+```
+
+w/ rawHTML extension a checkbox by itself is kept
+```
+% pandoc -f html+raw_html -t html+raw_html
+<input type="checkbox" checked="" />
+^D
+<input type="checkbox" checked>
+</input>
+```
+
+w/ rawHTML extension, a checkbox in an `li` is handled properly
+```
+% pandoc -f html+raw_html -t html+raw_html
+<ul>
+<li><input type="checkbox" checked/>foo</li>
+</ul>
+^D
+<ul class="task-list">
+<li><label><input type="checkbox" checked="" />foo</label></li>
+</ul>
+```
+
+w/o rawHTML extension, a checkbox outside of an `li` is properly ignored
+```
+% pandoc -f html -t html
+<p><input type="checkbox" checked/>foo</p>
+^D
+foo
+```
diff --git a/test/command/tasklist.md b/test/command/tasklist.md
index b1c6491cc..9aaa0a8aa 100644
--- a/test/command/tasklist.md
+++ b/test/command/tasklist.md
@@ -102,4 +102,4 @@ round trip:
^D
- [ ] foo
- [x] bar
-```
+``` \ No newline at end of file