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

add tasklist extension #94

Merged
merged 7 commits into from
Dec 2, 2018
Merged

add tasklist extension #94

merged 7 commits into from
Dec 2, 2018

Conversation

Watson1978
Copy link

This patch will parse Task list items (extension) in GitHub Flavored Markdown Spec.

$ cat sample1.md
- foo
  - [ ] bar
    - baz
      - [x] hoge
          - [ ] fuga

$ ./cmark-gfm -e tasklist ~/sample1.md
<ul>
<li>foo
<ul>
<li class='task-list-item'><input type='checkbox' disabled='' />bar
<ul>
<li>baz
<ul>
<li class='task-list-item'><input type='checkbox' checked='' disabled='' />hoge
<ul>
<li class='task-list-item'><input type='checkbox' disabled='' />fuga</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>

@eldridge
Copy link

This extension is working well for me on Linux. It looks like the AppVeyor build is failing because compiler warnings are treated as errors and the two unused variables in the no-op _scan_tasklist function are generating warnings.

One suggestion I have is to include a element for the task item content so that replacement of the input form element can be done with pure CSS a la this StackOverflow thread.

@waldyrious
Copy link

Hey @Watson1978, out of curiosity -- would supporting tri-state checkboxes be in-scope for this extension? The lack of an indeterminate or N/A state has been a consistent point of friction for me in GitHub's current implementation.

@Watson1978 Watson1978 force-pushed the tasklist branch 3 times, most recently from c69ba25 to a243d1b Compare October 28, 2018 01:28
@doits
Copy link

doits commented Nov 30, 2018

Any chance this gets picked up? It is the only thing missing for me to switch to this library for markdown rendering.

> Two list items are of the same type if they begin with a list marker of the same type. Two list markers are of the same type if (a) they are bullet list markers using the same character (-, +, or *) or (b) they are ordered list numbers with the same delimiter (either . or )).

( https://github.github.com/gfm/#task-list-items-extension- )
@kivikakk
Copy link

kivikakk commented Dec 2, 2018

It makes sense. I'll test this and merge.

@kivikakk
Copy link

kivikakk commented Dec 2, 2018

Added some tests and addressed bugs that showed as a result.

@kivikakk kivikakk merged commit 6d60bfa into github:master Dec 2, 2018
@kivikakk
Copy link

kivikakk commented Dec 2, 2018

@Watson1978 Let me know what name you'd like to be used in attribution for this PR for the changelog and releases!

@kivikakk
Copy link

kivikakk commented Dec 2, 2018

Likewise, let me know if you need a new release made.

@Watson1978
Copy link
Author

@kivikakk Thank you for merging this!! I prefer that you will use my github account name :)

Watson1978 added a commit to Watson1978/QLMarkdownGFM that referenced this pull request Jan 13, 2019
@Watson1978 Watson1978 deleted the tasklist branch January 13, 2019 15:24
@doits
Copy link

doits commented Jan 31, 2019

Any chance to have a new version released because of this?

@kivikakk
Copy link

@doits I've tagged the release 0.28.3.gfm.20!

@doits
Copy link

doits commented Feb 6, 2019

@kivikakk thanks!

talum pushed a commit that referenced this pull request Sep 14, 2021
* add tasklist extension

* recognize “+” as list marker

* use long type to avoid warning in MSVC environment

* recognize ordered list

> Two list items are of the same type if they begin with a list marker of the same type. Two list markers are of the same type if (a) they are bullet list markers using the same character (-, +, or *) or (b) they are ordered list numbers with the same delimiter (either . or )).

( https://github.github.com/gfm/#task-list-items-extension- )

* add preliminary tests

* fix regular extension tests

* fix tasklist nesting
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.

5 participants