Skip to content
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

Display a chechbox for checkboxes. #102

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Conversation

dcampbell24
Copy link
Contributor

I am not very familiar with javascript, but I did my best to submit a valid change. I want to change the rust dependency jotdown, so I am submitting an upsteam change. I think you should display a checkbox for task items.

@jgm
Copy link
Owner

jgm commented Nov 12, 2024

I think that if we do merge this, we might not want to include the class checked or unchecked on li. Reason: people currently use CSS with these to include a unicode checked or unchecked checkbox (see the sandbox for an example). (And, with that CSS, a checkbox does display---it's just not one you can check or uncheck interactively.) After this change, using the same CSS would result in a doubled checkbox.

I think that using an input element as you do is the way it's currently done on GitHub and other places (e.g. pandoc), and it probably makes good sense. Any thoughts @matklad ?

@matklad
Copy link
Contributor

matklad commented Nov 12, 2024

  • The current behavior of using unicode symbols in HTML for checkboxes makes no sense to me, given HTML has checkboxes. So I am strongly in favor of merging something like this.
  • I agree that we don't need checked and unchecked classes on li --- both because of compatibility argument, and because these are now redundant with checked state of the underlying input
  • We need to keep the task-list class on the list itself (ul) --- this solution still requires custom CSS to remove the redundant list marker.

@jgm jgm merged commit a50487c into jgm:main Nov 12, 2024
1 check passed
@jgm
Copy link
Owner

jgm commented Nov 12, 2024

Thanks!

@dcampbell24 dcampbell24 deleted the show-checkboxes branch November 13, 2024 00:04
@KyleKing
Copy link

It would be great to have this change released to npm! I'm currently installing from GitHub locally because my markup heavily uses checkboxes

npx github:jgm/djot.js -f djot -t html docs/README.dj > public/README.html

@jgm
Copy link
Owner

jgm commented Dec 19, 2024

Released 0.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants