-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(#11): include input checkbox for task lists #12
Draft
KyleKing
wants to merge
18
commits into
sivukhin:master
Choose a base branch
from
KyleKing:fix-11
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
53b5d9c
ci: update linter
KyleKing 5c03784
test: add red test
KyleKing 08c88cd
wip: attempt to insert the input
KyleKing 4fcdfca
feat: add InputNode
KyleKing 57f333a
ci: fix lint failure and warning
KyleKing ca4da4a
refactor: restore to master
KyleKing e1f8a03
Merge branch 'master' into fix-11
KyleKing d0f81f0
feat: write input
KyleKing ea3f76f
refactor: replace strings with const
KyleKing ab4b5a7
refactor: try BlockNodeConverter
KyleKing 05a9f2f
Revert "refactor: try BlockNodeConverter"
KyleKing 1df7eef
test: add failing fuzz test
KyleKing 032e79c
fix: handle checklist without content
KyleKing 3f25070
fix: render all node children
KyleKing f0deea2
test: improve todo list unit test
KyleKing 8feacbd
test: add nested paragraph
KyleKing 4b28fbd
test: set expected output
KyleKing f3e6a2d
Revert "test: set expected output"
KyleKing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
- [ ] unchecked | ||
|
||
* 1 | ||
* 2 | ||
* 3 | ||
- [x] checked | ||
- [ ] finish | ||
- [ ] Inline _formatting ([link](https://google.com))_ | ||
- [ ] finish |
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 |
---|---|---|
@@ -1,11 +1,30 @@ | ||
<ul class="task-list"> | ||
<li class="unchecked"> | ||
<li> | ||
<input disabled="" type="checkbox"/> | ||
unchecked | ||
<ul> | ||
<li> | ||
1 | ||
</li> | ||
<li class="checked"> | ||
<li> | ||
2 | ||
</li> | ||
<li> | ||
3 | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
<input disabled="" type="checkbox" checked=""/> | ||
checked | ||
</li> | ||
<li class="unchecked"> | ||
<li> | ||
<input disabled="" type="checkbox"/> | ||
Inline <em>formatting (<a href="https://google.com">link</a>)</em> | ||
</li> | ||
<li> | ||
<input disabled="" type="checkbox"/> | ||
finish | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll figure out how to output HTML without this extra newline tomorrow, which may be the last change necessary |
||
</li> | ||
</ul> |
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,5 @@ | ||
- [ ] an unchecked task list item | ||
|
||
with two paragraphs | ||
|
||
- [x] checked item |
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,11 @@ | ||
<ul class="task-list"> | ||
<li> | ||
<input disabled="" type="checkbox"/> | ||
<p>an unchecked task list item</p> | ||
<p>with two paragraphs</p> | ||
</li> | ||
<li> | ||
<input disabled="" type="checkbox" checked=""/> | ||
<p>checked item</p> | ||
</li> | ||
</ul> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add one more test where checkbox item list will have some non-paragraph content inside like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other change to consider are nested paragraphs like the djot.js test: https://github.com/dcampbell24/djot.js/blob/22470195eb0dc1fc942b34b7c8d95b23597c094a/test/task_lists.test
I added the test from
djot.js
verbatim. While the*
-based lists are currently failing, I can address that in a future PR (https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#list-item)