Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,4 @@ round trip: | |
^D | ||
- [ ] foo | ||
- [x] bar | ||
``` | ||
``` |