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

GFM mode does not support check boxes #346

Closed
binduwavell opened this Issue Jun 12, 2016 · 15 comments

Comments

Projects
None yet
5 participants
@binduwavell

binduwavell commented Jun 12, 2016

-[ ] is unchecked
-[x] is checked


  • is unchecked
  • is checked
@gettalong

This comment has been minimized.

Owner

gettalong commented Jun 12, 2016

Pull requests are welcome if this feature should be implemented.

@imkean

This comment has been minimized.

imkean commented Jun 28, 2016

+1

1 similar comment
@BobWalsh

This comment has been minimized.

BobWalsh commented Jul 31, 2016

+1

@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 8, 2016

Dear people from the future, if you want to +1, please use this feature from the future: https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments 😄

@gettalong gettalong self-assigned this Aug 14, 2016

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 14, 2016

Can anyone provide the HTML output for this?

And use cases for this feature? I imagine this being nice in an issue or pull request but what should it do when used with kramdown on a plain website?

@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 15, 2016

@gettalong

- [ ] first item
- [x] second item

would result in:

<ul class="contains-task-list">
<li class="task-list-item enabled"><input type="checkbox" class="task-list-item-checkbox"> first item</li>
<li class="task-list-item enabled"><input type="checkbox" class="task-list-item-checkbox" checked=""> second item</li>
</ul>

for logged in user with permissions and

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled=""> first item</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" checked="" disabled=""> second item</li>
</ul>

for logged out user or user without permission on GitHub.

Since kramdown does not know about any permissions I suggest dropping the enabled / disabled. So this would be a great output:

<ul class="task-list">
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox"> first item</li>
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" checked=""> second item</li>
</ul>

And use cases for this feature? I imagine this being nice in an issue or pull request but what should it do when used with kramdown on a plain website?

Please keep in mind that kramdown is not only used for plain websites. 😄 GitLab is actually considering using kramdown for all its Markdown rendering: https://gitlab.com/gitlab-org/gitlab-ce/issues/18552

@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 15, 2016

one corner case:

- [ ] first item
- [x] second item

[ ]: http://space.example
[x]: http://x.example

renders like this on GitHub:

  • first item
  • x second item
@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 15, 2016

Another request for Markdown rendering on GitLab was to support arbitrary whitespace within [ ]. See also https://gitlab.com/gitlab-org/gitlab-ce/issues/2949

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 15, 2016

@winniehell Thanks for your feedback!

Regarding the output: I would prefer the HTML output with the checkboxes disabled because this would work on any website, not just "checkbox aware" sites. This would have the advantage that clicking on the checkboxes wouldn't change the state of them and would lead to users expecting some change.

As for the corner case: This is no corner case in my opinion since the syntax description would say something like "If the list item marker is followed by an opening square bracket, a space or an uppercase/ lowercase ASCII 'x' character, and a closing square bracket, ...". So if the user doesn't use this, it won't work.

If we would handle your supposed corner case, what would you do about intermingled zero-width spaces? En or em spaces? I don't think such things can easily be handled in a general way, especially if you want to handle all possibly Unicode characters that look similar...

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 15, 2016

@winniehell The corner case I mentioned was for the arbitrary whitespace case.

As for the link case: I think that handling them as checkboxes would be the right call here, and not treating them as reference links.

@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 15, 2016

@gettalong

I would prefer the HTML output with the checkboxes disable

Sure, that makes sense. 👍

This is no corner case in my opinion

Maybe corner case wasn't the right term. 😉 It's just a situation where it has to be decided whether task lists or links have precedence.

I think that handling them as checkboxes would be the right call here

I actually prefer that myself, too. 😄 I think that case is more likely.

what would you do about intermingled zero-width spaces?

I would have used [:blank:] to match the space: http://rubular.com/r/ADZYvFCrsM

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 16, 2016

Using a Unicode character property matcher like [:blank:] would potentially lead to very confusing results, see http://rubular.com/r/aqgr63mPSS where I amended your example with some more possible variations.

I would stay in the ASCII world and just the simple space and nothing else. In the issue you link the problem is not that the user doesn't want to use spaces but that he accidentally uses non-breaking spaces due to OS X keyboard layout. We can't really solve that problem...

@winniehell

This comment has been minimized.

Contributor

winniehell commented Aug 16, 2016

would potentially lead to very confusing results

I am not sure that I agree the result is confusing but let's not discuss about spaces here. 😄

due to OS X keyboard layout. We can't really solve that problem...

That sounds desperate but I get your point. 😉

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 16, 2016

Not really desperate since I'm not using OS X anymore 😉

@gettalong

This comment has been minimized.

Owner

gettalong commented Nov 5, 2016

Closed because feature request issues are now tracked through a dedicated project - see https://github.com/gettalong/kramdown/projects/1

@gettalong gettalong closed this Nov 5, 2016

@gettalong gettalong removed this from Needing Pull Requests in Feature Requests Nov 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment