Skip to content

Github Task Lists - #587

Closed
jhollingworth wants to merge 2 commits into
markedjs:masterfrom
jhollingworth:master
Closed

Github Task Lists#587
jhollingworth wants to merge 2 commits into
markedjs:masterfrom
jhollingworth:master

Conversation

@jhollingworth

Copy link
Copy Markdown

Add support for Github Task Lists under the gfm flag.

Changes to API

  • list(string body, boolean ordered, boolean taskList)
  • listitem(string text, [boolean checked]).

checked is defined when you have a list item which starts with [ ] or
[x].If defined its a boolean depending on whether the x is
present. When checked is defined we add a input type type checkbox to
the list item and add the class task-list-item-checkbox.

taskList is true if a list has any list items where checked is
defined. When true we add the class task-list to the list.

Resolves#107

Add support for Github Task Lists under the gfm flag.
Changes to API
* list(*string* body, *boolean* ordered, *boolean* taskList)
* listitem(*string* text, [*boolean* checked]).
`checked` is defined when you have a list item which starts with `[ ] ` or
`[x] `.If defined its a boolean depending on whether the `x` is
present. When checked is defined we add a input type type `checkbox` to
the list item and add the class `task-list-item-checkbox`.
`taskList` is true if a list has any list items where `checked` is
defined. When true we add the class `task-list` to the list.
Resolvesmarkedjs#107
@styfle

Copy link
Copy Markdown
Member

@jhollingworth
Very cool. Hopefully this gets merged.
However this project doesn't seem very active anymore.
You might want to checkout markdown-it

@chjj

chjj commented May 8, 2015

Copy link
Copy Markdown
Member

I had an implementation of this that I reverted because I was originally completely against further GFM extras. I thought I had lost it when my laptop bricked, but I realized it wasn't on a separate unpushed branch. It's in the git history: #107

I'll compare these two.

@jhollingworth

Copy link
Copy Markdown
Author

do you mean 26cef98 and a5e39a6? The one issue I saw with yours was it does not support the scenario where a list has items that are not checkboxes.

  • Foo
  • Bar
  • Baz

Also, have your view changed on adding GFM extras or do you not want to merge this?

Comment threadlib/marked.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to GFM docs [v] is a valid way to indicate a task is complete as well.

@ghost

Copy link
Copy Markdown

@jhollingworth thanks for starting with the lexer as that fits my use case.

@felixSchl

Copy link
Copy Markdown

What's happening with this?

@at15at15 mentioned this pull request Aug 4, 2015
2 tasks
@cdaguerre

Copy link
Copy Markdown

Will this make it to core? Any ETA?

@dvcrn

Copy link
Copy Markdown

Using this code in a app right now and seems to work good. Would love to see this getting merged back

screen shot 2015-11-11 at 2 39 31 pm

levlaz pushed a commit to levlaz/braindump that referenced this pull request Nov 25, 2015
Permalink are now created for notes.
GFM TaksLists are supported now. :) Thanks to
[this](markedjs/marked#587) PR.
@levlazlevlaz mentioned this pull request Nov 25, 2015
@msto

msto commented Dec 19, 2015

Copy link
Copy Markdown

Any chance of this getting pulled in in the near future? Would love to have checkboxes available in ipython notebooks, and they're waiting on it to be implemented here.

ipython/ipython#8402
ipython/ipython#6288

@noerw

noerw commented Feb 9, 2016

Copy link
Copy Markdown

would love to see this too

@Sohalt

Copy link
Copy Markdown

Any updates on this?
This would make integration of checklists for https://github.com/wekan/wekan much easier.

@SohaltSohalt mentioned this pull request Feb 19, 2016
@ousamabenyounes

Copy link
Copy Markdown

Checklist feature is an important feature for wekan project...
So merging this pull request would help developpers to finish this other pull request wekan/wekan#298 (comment) and be sure they won't use another alternative...Hope to see this on wekan project soon...

@chrisdias

Copy link
Copy Markdown

Hi! Any chance this will get merged? We would like top pick up this fix for VS Code.

@dvcrn

Copy link
Copy Markdown

This project is definitely dead. I merged this in a own fork and use that for markright

@clehnerclehner mentioned this pull request Apr 24, 2016
@ZackWard

Copy link
Copy Markdown

@matt-@parleur Thank you for maintaining this project. I would love to +1 this PR.

@odama626

Copy link
Copy Markdown

I too am hoping this will be merged, in the meantime I am using a simple wrapper function to achieve this. Maybe this will help someone until then.

function markdownFormatter(text) {
var a = marked(text, {break: true});
a = a.replace(/<a/g, '<a target="_blank"')
.replace(/<li>\[\s\]/g, '<li class="check-box"><input onclick="return false" type="checkbox">')
.replace(/<li>\[x\]/g, '<li class="check-box"><input checked onclick="return false" type="checkbox">');
return a;
}

@jbddc

Copy link
Copy Markdown

+1

@stanleykylee

Copy link
Copy Markdown

@chjj@matt- any updates on whether or not this will be merged as it is approved now?

@heaven00

heaven00 commented Jul 2, 2017

Copy link
Copy Markdown

would love to have this! 👍

@styfle

Copy link
Copy Markdown
Member

To reference myself above:

Many users have migrated from marked to markdown-it due to inactivity and failure to merge the 163 pending PRs. This PR in particular has at least 30 people interested but it's mostly too late.

@chrisdias@richarddavenport
VS Code switched to markdown-it and now has plugin to support Task Lists
https://github.com/mjbvz/vscode-markdown-checkboxes

@samiraguiar

Copy link
Copy Markdown

Thank you, @styfle, I had missed your comment. Now I can finally unsubscribe from this thread.

@Xaekai

Copy link
Copy Markdown

I guess I'm going to give up too and switch to markdown-it

The negligence of the maintainers here is unacceptable. I've waited over a year.

@joshbruce

joshbruce commented Dec 6, 2017

Copy link
Copy Markdown
Member

See #956

Focusing on CommonMark and GFM specifications, without extensions (task lists in GFM are an extension not part of core). Cleaning house and assessing the damage. If this gets implemented it will probably be through extension via open/closed.

Thanks, and apologies for the inconvenience.

@joshbruce

Copy link
Copy Markdown
Member

Reopening as things have changed a bit. We are looking to support GFM, which is only CommonMark with extensions. We have two test beds at present one for CommonMark the other for GFM. There are two failing tests (both examples) in the task list test suite.

Can we verify this solution causes those to pass?

@joshbrucejoshbruce reopened this Apr 13, 2018
Comment threadREADME.md
- del(*string* text)
- link(*string* href, *string* title, *string* text)
- link(*string* href, *string* title, *string* text, [*boolean* checked]).
- `checked` only defined when `gfm` is `true` and there is a check box at the start of the list item (e.g. `* [ ] foo`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was moved to USING_PRO.md. and is causing merge conflicts.

@huruji

huruji commented Apr 17, 2018

Copy link
Copy Markdown

thanks for the creator and maintainers' job, I hope I can see checkbox in my project,thank you

@styfle
styfle requested review from UziTech and joshbruceApril 17, 2018 21:09
@styfle

Copy link
Copy Markdown
Member

@jhollingworth Are you still interested in working on this PR?

@joshbruce

Copy link
Copy Markdown
Member

Going to go ahead and close as overcome by events. If you would like to continue working toward this goal:

  1. Read Defibrillator challenge #1216
  2. Submit a PR that solves GFM example 272 and 273 in the gfm/gfm-spec.js file.

@tomtheisentomtheisen mentioned this pull request May 8, 2018
5 tasks
@30Wedge

Copy link
Copy Markdown

Ping; I want to show that I'm still interested in this PR.
Jupyter uses marked, and I'd like to use gfm task lists in my notebook.

@joshbruce

Copy link
Copy Markdown
Member

@30Wedge: What version of Marked are you using?

0.4.0 should include task lists if I'm remembering #1250 properly.

@30Wedge

Copy link
Copy Markdown

Looks like they were using 0.3.0
Thanks for responding so quickly!

Sign up for freeto 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.

To do lists

20 participants

@jhollingworth@styfle@chjj@felixSchl@cdaguerre@dvcrn@msto@noerw@Sohalt@ousamabenyounes@chrisdias@ZackWard@Xaekai@wujr5@richarddavenport@matt-@samiraguiar@Agent01@mspiegel@jpouellet