镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed

Description

@driftluo

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

Activity

  1. joshbruce commented on Dec 1, 2017

    @joshbruce
    Member

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

  2. driftluo commented on Dec 2, 2017

    @driftluo
    Author

    browser

  3. joshbruce commented on Dec 3, 2017

    @joshbruce
    Member

    The expectation would be something more like this, yeah:

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

    Yeah?

  4. driftluo commented on Dec 3, 2017

    @driftluo
    Author

    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>
  5. joshbruce commented on Dec 3, 2017

    @joshbruce
    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?

  6. added
    L1 - brokenValid usage causes incorrect output OR a crash AND there is no known workaround for the issue
    on Dec 3, 2017
  7. UziTech commented on Dec 4, 2017

    @UziTech
    Member

    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.

  8. fboes commented on Dec 5, 2017

    @fboes

    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 😁 ).

  9. joshbruce commented on Dec 25, 2017

    @joshbruce
    Member

    See #982

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    L1 - brokenValid usage causes incorrect output OR a crash AND there is no known workaround for the issuequestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions