-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add TODO list support for Blackfriday #2296
Conversation
But we need to add a CSS-class somewhere so it is possible to hide the list bullet (as GitHub does). /cc @phtan |
This is how GitHub does it for the li-item:
|
I have rebased this against master now and I suspect the tests will pass. I'm planning to implement this for the MMark renderer, too, but I kind of need this code to do that. @digitalcraftsman @moorereason I know this works, but do you have any complaints? Good to merge? |
Any reason why you set <input type="checkbox" checked disabled class="task-list-item"> |
If you followed the looooong discussion in the related issue you will see that the core part of the implementation is borrowed from @shurcooL ... Knowing that he writes compilers for fun (gopherjs), I'm pretty sure he is correct. And reading the spec (https://www.w3.org/TR/html-markup/syntax.html#syntax-attributes), I don't see any "attribute without value" option. It probably works in most (all?) browsers, but isn't entirely correct. |
Have another look: https://www.w3.org/TR/html-markup/syntax.html#syntax-attr-empty |
Thanks, but I would recommend reviewing that code from scratch. I wrote it a while ago and decisions/research done back then may not apply or still be valid today. It also highly depends on the context where it's used (version of HTML, etc.).
There was no good reason, it was just one of many ways of doing it. I think your suggestion is valid and makes sense. But I haven't looked at the specifics of HTML/XHTML versions hugo uses, its browser support, etc. |
Both variants is fine, then. I chose the one with the least amount of work. |
`checked` and `disabled` doesn't have to have an empty value. See gohugoio#2296
@moorereason I have simplified the HTML attributes re. your comment, does it then look generally OK? @shurcooL if people use your GitHub renderer (or whatever it is named), you should take another look at your TODO-list implementation. A HTML list without any CSS classes isn't very easy to style. |
The commit looks fine. I agree with @moorereason that the empty strings can be removed because the w3c spec handles them equivalent:
|
The goal of the |
I don't use that repo, just giving you a heads up. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #2269