Open iamcarbon opened 4 years ago
You can check my implementation here: https://github.com/ocavue/rino/blob/5136c00f17365ebd8d8f43c45a627780401b1476/packages/web/src/editor/extensions/list/list-extension.ts#L199
it's written in typescript and remirror so the code can't be copy directly into Prosemirror-Mardkown, but you should get the idea easily.
taskList(state, node, parent, index) {
state.renderList(node, ' ', i => (node.child(i).attrs.checked ? '- [x] ' : '- [ ] '))
},
this may be all thats needed, haven't tested it thoroughly, but taskList is the node name from my doc.type.schema
It would be useful to support the task list extension in the library (used by GitHUB and others). Happy to sponsor the time on the work if this is a feature the library would accept.
Here's the specification.
https://docs.github.com/en/github/managing-your-work-on-github/about-task-lists