Files
pandoc/test/command/9047.md
Seth Speaks 0d27947b96 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
2023-09-16 09:21:01 -07:00

48 lines
1.2 KiB
Markdown

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
```