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

Task list can't be resolve, is there a bug or a feature? #952

Closed
driftluo opened this issue Nov 10, 2017 · 8 comments
Closed

Task list can't be resolve, is there a bug or a feature? #952

driftluo opened this issue Nov 10, 2017 · 8 comments
Labels
L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue question

Comments

@driftluo
Copy link

when I use in brower, marked.js is in marked project's lib folder

<script src="js/marked.js"></script>
> marked('- [ ] x')
"<ul>
<li>[ ] x</li>
</ul>
"

and there is same issue on https://github.com/8fold/marked
@8fold

@joshbruce
Copy link
Member

Do you mean bower or browser? Not sure I follow exactly what's expected versus what's being received.

@driftluo
Copy link
Author

driftluo commented Dec 2, 2017

browser

@joshbruce
Copy link
Member

The expectation would be something more like this, yeah:

<ul>
  <li><input type=”checkbox”><label>Hello</label></li>
</ul>

Yeah?

@driftluo
Copy link
Author

driftluo commented Dec 3, 2017

In github, it will be like this:

<ul class="contains-task-list">
  <li class="task-list-item">
  <input class="task-list-item-checkbox" disabled="" id="" type="checkbox"> Hello</li>
</ul>

@joshbruce
Copy link
Member

@driftluo: Thanks for that. Think we would leave out the classes. Basically, give back the input and type. From an HTML perspective, I don't place a lot fo form controls outside of forms; so, is the GitHub markup accessible (what's the experience like for a blind person, for example).

@UziTech: Thoughts?

@joshbruce joshbruce added the L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue label Dec 3, 2017
@joshbruce joshbruce mentioned this issue Dec 3, 2017
@UziTech
Copy link
Member

UziTech commented Dec 4, 2017

I'm not sure that would be in scope for this package.

Maybe if we add extensions like markdown-it. Seems like you would want to use markdown-it-checkbox.

@fboes
Copy link

fboes commented Dec 5, 2017

I added a simple fix for this locally, without altering marked:

marked('- [ ] x')
  .replace(/(<li>)\[ \](\s)/g,'$1<input type="checkbox" />$2'))
  .replace(/(<li>)\[x\](\s)/g,'$1<input type="checkbox" checked="checked" />$2');

I am also not sure if it is a good thing to change this behavior. Some implementations might depend on how marked is currently working (like mine 😁 ).

@joshbruce
Copy link
Member

See #982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue question
Projects
None yet
Development

No branches or pull requests

4 participants